As of 2022-04-11, when Wikibase REST API is asked for data of an item which is a redirect to another item, requests results in 500 HTTP response containing
`{"code":"unexpected-error","message":"Unexpected error"}`
Instead, the API should recognize the redirect, and point the client to the relevant resource.
BDD
GIVEN Q123 is a redirect to Q321
WHEN I make a GET request to /entities/items/Q123
THEN I receive 301 HTTP response from the API
AND `Location` header in the response points to /entities/items/Q321
AND response body is empty
Note:
- if a user has no permission to get item data, they should get unauthorized access error not a 301 response
Open question: what should happen with query parameters, are they included in the Location header in the response, or is the "raw" URL returned - @WMDE-leszek to define