Skip to content

Conversation

@mkirkeng-leukeleu
Copy link
Member

This is to make sure the HTTP method and body are kept intact when redirecting (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308 for more). Previously any non-GET request to the http:... or www.... urls would be redirected (which is correct) but their methods would be reset to GET and the body lost.

This is to make sure the HTTP method and body are kept intact when redirecting
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308 for more.
@mkirkeng-leukeleu
Copy link
Member Author

If we like this we should probably upstream this to DCS.

@bheesink bheesink self-requested a review October 28, 2025 17:52
@153957 153957 added the TPL decision needed TPLs need to decide on this label Nov 26, 2025
@153957
Copy link
Member

153957 commented Dec 1, 2025

Where did you encountered an issue with requests changing methods? Was it specific for the OIDC case?
Perhaps errors in other cases could indicate misconfiguration and should be fixed elsewhere (configuration)?

@mkirkeng-leukeleu
Copy link
Member Author

mkirkeng-leukeleu commented Dec 1, 2025

Where did you encountered an issue with requests changing methods? Was it specific for the OIDC case? Perhaps errors in other cases could indicate misconfiguration and should be fixed elsewhere (configuration)?

IIRC it was noticed because of headless hidp. Request to DRF still go though nginx and any POST/PUT/PATCH requests would loose their body if send to an url without the www subdomain. So locally I would POST something to https://hidp.test and it would fail.

Edit: technically I think it's the client that changes the method but that's allowed according to the spec on a 301 but not for a 308, see the first callout on this page.

@153957
Copy link
Member

153957 commented Dec 1, 2025

Ok, so a 'newer' client could have been used, or queries performed directly to the www.hidp.test domain. I assume the queries (to the non-www domain) showed strange and unintuitive/unexpected errors, so this would help avoid that?

Copy link
Member Author

mkirkeng-leukeleu commented Dec 1, 2025

Well the client in this case is just any client using the javascript fetch 😛 but yes queries directly to www. would also be a workaround (the one I have been using so far). But that's just a workaround and doesn't fix the issue. If forex. we configure any of our frontend applications to call the backend API using a url without the www. it would break there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker-setup TPL decision needed TPLs need to decide on this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants