Closed Dimitar5555 closed 1 week ago
This seems a bit odd. The POST request already returns an HTTP return code 303 along with a location: https://www.openstreetmap.org/messages/inbox
header for the redirect.
According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303 the browser is supposed to ignore the payload in the body and follow the redirect. I'm not clear why Rails is sending the payload as well in this case, which seems a bit pointless.
Code in question: https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/messages_controller.rb#L141-L145
I'm not convinced that POST actually sends the response body even though Firefox shows it. Compare your "receiving" timings for POST and GET.
@AntonKhorev : you're right. I checked the response in wireshark, and the POST request returns HTTP 303 with an empty response body.
Closing here, since there's no issue really.
URL
https://www.openstreetmap.org/messages/inbox
How to reproduce the issue?
The POST request goes to
https://www.openstreetmap.org/messages/{id}/mark?mark=unread
, while the GET request goes tohttps://www.openstreetmap.org/messages/inbox
. Both requests return the same HTML code, which seems a bit wasteful on server resources if both are generated independently.The most logical solution would be to change the response body of the POST request to have some short status code/text instead of the whole page HTML (assuming that won't break the turbo integration).
Screenshot(s) or anything else?