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

Cannot pass the :scheme header from command line. #8381

Closed
siddharthchhabrap opened this issue Feb 3, 2022 · 4 comments
Closed

Cannot pass the :scheme header from command line. #8381

siddharthchhabrap opened this issue Feb 3, 2022 · 4 comments
Labels

Comments

@siddharthchhabrap
Copy link

@siddharthchhabrap siddharthchhabrap commented Feb 3, 2022

I did this

curl -v http://127.0.0.1 --http2-prior-knowledge --header ":scheme:aaa"

  • Trying 127.0.0.1:80...
  • Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
  • Using HTTP2, server supports multi-use
  • Connection state changed (HTTP/2 confirmed)
  • Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  • Failed sending HTTP request
  • Connection #0 to host 127.0.0.1 left intact
    curl: (55) Failed sending HTTP request

I expected the following

I expected the :scheme header to be passed for the http2 request and get a server response.

curl/libcurl version

curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0
Release-Date: 2021-05-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSocket

operating system

Mac OS X 12.1 Monterey.

@jay
Copy link
Member

@jay jay commented Feb 3, 2022

I expected the :scheme header to be passed for the http2 request and get a server response.

Can you give an example where it would be useful to set scheme?

@jay jay added the HTTP/2 label Feb 3, 2022
@bagder
Copy link
Member

@bagder bagder commented Feb 4, 2022

Ah yes! h2 (and h3) pseudo headers cannot be replaced, removed or added actually. I consider this a mistake we should fix.

bagder added a commit that referenced this issue Feb 5, 2022
The only h2 psuedo header that wasn't previously possible to change by a
user. This change also makes it impossible to send a HTTP/1 header that
starts with a colon, which I don't think anyone does anyway.

The other pseudo headers are possible to change indirectly by doing the
rightly crafted request.

Reported-by: siddharthchhabrap on github
Fixes #8381
@mkauf
Copy link
Contributor

@mkauf mkauf commented Mar 1, 2022

The new log message contains a typo: "pseduo"

jay added a commit that referenced this issue Mar 1, 2022
Bug: #8381 (comment)
Reported-by: Michael Kaufmann
@jay
Copy link
Member

@jay jay commented Mar 1, 2022

The new log message contains a typo: "pseduo"

Thanks, landed in 592f114.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants