Page MenuHomePhabricator

🟩️ Generate location header from response
Closed, ResolvedPublic

Description

The Location header should point to the URL of the item specific single statement endpoint, i.e. a full URL ending in /entities/items/{item_id}/statements/{statement_id}.

Event Timeline

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

[mediawiki/extensions/Wikibase@master] REST: Add Location header to POST response

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

Change 806169 abandoned by Silvan Heintze:

[mediawiki/extensions/Wikibase@master] REST: Add Location header to POST response

Reason:

see I5fc99f1da8ec33adf26757e2d73a82640ca72cda

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

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

[mediawiki/extensions/Wikibase@master] REST: Add Location header to POST response

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

Change 806199 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Add Location header to POST response

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

Change 806907 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Test that route paths are consistent

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

Silvan_WMDE added a subscriber: WMDE-leszek.

Pls note that the Location header value holds the URL to the newly created statement in url-encoded format, which means the statement guid Q42$... becomes Q42%24..., which isn't very pretty. @WMDE-leszek Should this be changed or do you agree that tools and gadgets won't actually care much about Location header URL's prettiness?

Change 806907 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Test that route paths are consistent

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

Pls note that the Location header value holds the URL to the newly created statement in url-encoded format, which means the statement guid Q42$... becomes Q42%24..., which isn't very pretty. @WMDE-leszek Should this be changed or do you agree that tools and gadgets won't actually care much about Location header URL's prettiness?

It is my understanding it is still perfect valid URL/URI, and therefore is okay to serve to clients.
The prettiness dimension is subjective and not relevant here.

Thank you.