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

awc: HTTP2 + set Host header + nginx server = 400 bad request #3495

Open
Originalimoc opened this issue Nov 4, 2024 · 0 comments
Open

awc: HTTP2 + set Host header + nginx server = 400 bad request #3495

Originalimoc opened this issue Nov 4, 2024 · 0 comments

Comments

@Originalimoc
Copy link

Your issue may already be reported! Please search on the Actix Web issue tracker before creating one.

Expected Behavior

No error.

Current Behavior

nginx will reply 400

Possible Solution

debug why the raw data queried is different:

[Mon Nov 04 15:24:49.726940 2024] [http2:debug] [pid 672786:tid 140502629656128] h2_session.c(353): [client 4.3.2.1:36688] AH10302: h2_stream(672786-8-1,IDLE): recv FRAME[HEADERS[length=122, hend=1, stream=1, eos=0]], frames=2/2 (r/s)
[Mon Nov 04 15:24:49.727757 2024] [:notice] [pid 672786:tid 140502789322304] [remote 4.3.2.1:36688] Header: Content-Length: 132
[Mon Nov 04 15:24:49.727871 2024] [:notice] [pid 672786:tid 140502789322304] [remote 4.3.2.1:36688] Header: Accept: */*
[Mon Nov 04 15:24:49.727908 2024] [:notice] [pid 672786:tid 140502789322304] [remote 4.3.2.1:36688] Header: Accept-Encoding: br, gzip, deflate, zstd
[Mon Nov 04 15:24:49.727938 2024] [:notice] [pid 672786:tid 140502789322304] [remote 4.3.2.1:36688] Header: Content-Type: application/json
[Mon Nov 04 15:24:49.727966 2024] [:notice] [pid 672786:tid 140502789322304] [remote 4.3.2.1:36688] Header: Authorization: Bearer 123456
[Mon Nov 04 15:24:49.727992 2024] [:notice] [pid 672786:tid 140502789322304] [remote 4.3.2.1:36688] Header: Host:foo.bar

Why length=122 when you call insert_header() or insert_header_if_none(), and length=132 if you don't call/let awc auto add it according to query URL. but Content-Length always 132.

Steps to Reproduce (for bugs)

Maybe later

Your Environment

Debian 12 + tried both rustls and openssl, h2 problem

  • Rust Version (I.e, output of rustc -V): 1.81
  • Actix Web Version: latest stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant