Skip to content
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

Bug: case sensitive handling of HTTP Header #1301

Open
AndreasBergmeier6176 opened this issue Aug 22, 2024 · 2 comments
Open

Bug: case sensitive handling of HTTP Header #1301

AndreasBergmeier6176 opened this issue Aug 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AndreasBergmeier6176
Copy link

AndreasBergmeier6176 commented Aug 22, 2024

What version of ogen are you using?

$ go list -m github.com/ogen-go/ogen

github.com/ogen-go/ogen v1.3.0

Can this issue be reproduced with the latest version?

Yes

What did you do?

Generate bindings. As a result the following was generated:

	if _, ok := r.Header["Content-Type"]; !ok && r.ContentLength == 0 {
		return req, close, nil
	}
	ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
	if err != nil {
		return req, close, errors.Wrap(err, "parse media type")
	}

What did you expect to see?

Would expect r.Headers to only be accessed via Get due to case insensitivity.

What did you see instead?

Direct access of r.Header["Content-Type"] which does not handle insensitivity.

@AndreasBergmeier6176 AndreasBergmeier6176 added the bug Something isn't working label Aug 22, 2024
@tdakkota
Copy link
Member

tdakkota commented Aug 22, 2024

Incoming headers are canonicalized by Go http server, not sure if it is really a problem.

@AndreasBergmeier6176
Copy link
Author

Are you sure this cannot be a problem when writing tests against the API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants