Okay, I figured it out. In that particular chunk of code I was
calling out to Curl to do the heavy lifting: “(run/port (curl
--silent --head ,source-url))”. Curl negotiates HTTP/2 and dumps
the header information:
HTTP/2 200
date: Tue, 07 Apr 2020 14:22:37 GMT
content-type: audio/mpeg
content-length: 31411830
The code then passed the response port to the existing
“read-response” function in the web/response module, to turn this
text into data objects.
That means this isn’t a “support HTTP/2 connections” change, it’s
just a “support parsing HTTP/2 responses” change.
However, sometime during all of this I figured out how to get the
system-installed extensions working with my personal build of
Guile, so the TLS extension now works and I can cut Curl out of
this code and just use “http-head”. We can drop this patch.
Thanks,
Derek
Derek Upham <derek_up...@mailfence.com> writes:
I made this particular tweak because Guile 2.2’s HTTP/1.1 client
requests were getting back an HTTP/2 response from a podcast
server, and choking. (The use of Google’s URL was just an
example to show the format of the HTTP response header.) Let’s
drop the
patch for now. I’ll try disabling it locally and see whether I
can still reproduce it. Given the amount of redirects that
media
website backends do, it’s possible that I’ll never come across
the problem again.
Derek
Tristan Colgate <tcolg...@gmail.com> writes:
http/2 is a substantially different protocol, it will take
considerable effort to support it, guile's client should only
be
offering http/1.1 to the server.
On Tue, 31 Mar 2020 at 15:49, Derek Upham
<derek_up...@mailfence.com> wrote:
Companies like Google now respond to HTTP requests with HTTP
2.
For example:
curl --silent --head https://www.google.com
returns the first line
HTTP/2 200
The Guile HTTP client code expects a “HTTP/x.y” structure, and
treats this as an error. This patch recognizes and handles
“HTTP/2” on input and output. HTTP version numbers don’t
proliferate quickly, so the code uses a brute force approach
for
now.
Derek
--
Derek Upham
derek_up...@mailfence.com
--
Derek Upham
derek_up...@mailfence.com