-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compat: /response-headers endpoint missing headers #141
Comments
I still think this is worth fixing, at least in part. Copying and lightly adapting a comment I left on the reporter's abandoned attempt to fix this issue: If we're aiming for compatibility, it's worth exploring what the original httpbin's behavior is in weird circumstances? Like, what happens with a request like Turns out, the behavior is interesting (TLS-related noise elided below):
I can convince myself that letting the incoming request to this specific endpoint dictate the actual Content-Length of the response could be useful for testing weird behavior in HTTP client or proxy code, so I'd be in favor of matching the Python implementation there. Note that there's a weird chicken/egg problem with the output from original httpbin above: It has the correct final I'm probably overthinking it or missing something comically obvious, but it turns out their implementation of this endpoint is a weird loop, presumably to solve this problem? |
FYI: It looks like @sonbui00 entered this ticket due to Argo Workflows depending on the However, this alternative isn't compatible with
The Go oauth2 library we're using has special behavior for |
@MasonM thanks for following up with a bit more context. I would love to find a way to support argo's use cases, especially since I've used argo's software in my own work! The But what if we made it possible for the request itself to specify the content type it wants in the response, either via a query param (e.g. This now seems like a generally useful and obvious-in-hindsight feature for this endpoint beyond just your use case, so if it seems reasonable to you I'd be happy to add the functionality (or review/accept a pull request adding it) — with the caveat that I won't be able to get to it till this weekend. But first please let me know if this would actually be an effective fix for you! |
… thinking this through just a little bit more, while this does immediately re-open the possibility of injected XSS, it does at least make the resulting content-type explicit in the request itself, so I'm convincing myself it's reasonable feature to add! (An httpbin-like service is in a weird spot in that it allows clients to generate potentially problematic requests by design and I don't think this reflected XSS edge case actually poses any real danger to clients, but if anyone can explain why it would I'd be happy to learn more.) |
Had a bit of extra time, see #198 for what I have in mind here. |
@mccutchen Thanks for the quick reply! To be clear, the workaround in https://github.com/argoproj/argo-workflows/pull/14239/files#r1976546694 is enough to support our use case, though it isn't ideal. We don't need compatibility with However, the workaround does rely on some hacky behavior in |
I got a different response.
The text was updated successfully, but these errors were encountered: