Page MenuHomePhabricator

Handle conditional HTTP headers when accessing property data
Closed, ResolvedPublic3 Estimated Story Points

Description

As a developer I want to fetch the data of a property, so I can use elements I need in my application

Further building up the GET /entities/properties/{property_id} route/endpoint, following the initial development in T337720.

Similar logic of handling If-None-Match, If-Modified-Since, as well as, If-Match, and If-Unmodified-Since as for the GET /entities/items/{item_id} route/endpoint,

Expected behaviour

  • If-None-Match
    • if the value includes the latest ETag: 304
    • if the value does not include the latest ETag: 200
    • if the value includes "*": 304
  • If-Match
    • if the value includes the latest ETag: 200
    • if the value does not include the latest ETag: 412
    • if the value includes "*": 200
  • If-Modified-Since
    • if value equals (or after) Last-Modified: 304
    • if value is before Last-Modified: 200
  • If-Modified-Since
    • if value equals (or after) Last-Modified: 200
    • if value is before Last-Modified: 412

If-Match, and If-Unmodified-Since are not the recommended/preferred headers but are handled for completeness.

The logic of evaluating multiple headers (order of evaluation etc) is to follow the standard: https://httpwg.org/specs/rfc9110.html#evaluation (as done to item related endpoints)

Event Timeline

Jakob_WMDE set the point value for this task to 3.Jun 8 2023, 9:21 AM

Change 930612 had a related patch set uploaded (by Silvan Heintze; author: Silvan Heintze):

[mediawiki/extensions/Wikibase@master] REST: Handle conditional requests for GET property

https://gerrit.wikimedia.org/r/930612

Change 930612 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Handle conditional requests for GET property

https://gerrit.wikimedia.org/r/930612