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

Multicodec Idea: HTTP Response as one codec? HTTP Request as a second? #360

Open
bumblefudge opened this issue Oct 10, 2024 · 1 comment

Comments

@bumblefudge
Copy link

@AaronGoldman mentioned a crazy idea that I think might be useful for some web-interop usecases I've been looking into: a codec for CIDv1 that described HTTP requests and another for HTTP responses. This would certainly have made Webrecorder and Internet Archive easier to build! Could also be useful for all kinds of automated testing, CI, etc etc. Any obvious reason why this could be a disaster or a footgun?

@AaronGoldman
Copy link

https://datatracker.ietf.org/doc/html/rfc7231
0x7231 and hex(7231) = 0x1c3f seam to be available.

Example Request

GET /logo.gif HTTP/1.1
Host: www.example.re
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1)
Accept: */*
Accept-Language: en-US, en; q=0.5
Accept-Encoding: gzip, deflate

Example Response

200 OK
Age: 8450220
Cache-Control: public, max-age=315360000
Connection: Keep-Alive
Content-Type: image/gif
Content-Length: 5000
Date: Thu, 01 Jan 1998 12:01:01 GMT
Last-Modified: Sun, 01 Jan 1995 12:01:00 GMT
Server: Apache

<The binary data for a 5K GIF image is included in the message body>

Note: Only a single multi-code is needed as all rfc7231 Requests start with a letter and all rfc7231 Responses start with a number.

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

2 participants