Hi all,
I currently have quite some scripts running on Perl 5.24 on a Microsoft Windows Server running IIS 10.0. On this server I use a certificate to for HTTPS connections. The scripts are all using the CGI.pm module to do CGI. As I do use Non-Parsed Headers (NPH), all my scripts start with the prefix "nph-" and have the following line to import the CGI module:
use CGI qw/:standard -nph/;
Now when a browser requests one of my scripts, these scripts are executed twice. I have made a Wireshark trace and I see the following happening:
- The browser does the TLS handshake
- The browser does a HTTP2 request to the script
- The server responds with HTTP_1_1_REQUIRED
- The browser does another request, but now uses HTTP/1.1
- The server sends a HTTP/1.1 response with the script output
This is most evident when Firefox is used, as it does not remember it should use HTTP/1.1 for the request, where Chrome, Edge and Safari do remember.
Now when I remove the "nph-" prefix from the script name (and do not change the contents), the following happens:
- The browser does the TLS handshake
- The browser does a HTTP2 request to the script
- The server sends the HTTP2 response with the script output
Now I could change all my script names by removing the "nph-" prefix, but it seems that the scripts do not really do NPH anymore as the server is sending back a HTTP2 response, whereas with the "nph-" prefix the exact headers as generated by my script are received by the browser.
Now my question: is it possible to HTTP2 via CGI using the CGI module or any other module?
Marcel
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.