Skip to content

Add blank line between headers and body in HTTP/1.0 examples#43389

Open
Kwpolska wants to merge 1 commit intomdn:mainfrom
Kwpolska:evolution-of-http-blank-lines
Open

Add blank line between headers and body in HTTP/1.0 examples#43389
Kwpolska wants to merge 1 commit intomdn:mainfrom
Kwpolska:evolution-of-http-blank-lines

Conversation

@Kwpolska
Copy link

@Kwpolska Kwpolska commented Mar 9, 2026

Make HTTP/1.0 examples conform to the spec.

https://datatracker.ietf.org/doc/html/rfc1945#section-4.1

Full-Request and Full-Response use the generic message format of RFC 822 for transferring entities. Both messages may include optional header fields (also known as "headers") and an entity body. The entity body is separated from the headers by a null line (i.e., a line with nothing preceding the CRLF).

@Kwpolska Kwpolska requested a review from a team as a code owner March 9, 2026 19:14
@Kwpolska Kwpolska requested review from pepelsbey and removed request for a team March 9, 2026 19:14
@github-actions github-actions bot added Content:HTTP HTTP docs size/xs [PR only] 0-5 LoC changed labels Mar 9, 2026
@pepelsbey
Copy link
Member

Hello! Thank you for the contribution. Have you tested the actual behavior? I wonder if request/response contain those lines in real life. We're documenting browser behavior, not just retelling the spec. So it's always important to test.

@Kwpolska
Copy link
Author

Kwpolska commented Mar 9, 2026

I’ve found a Docker image with the original CERN httpd which has the extra blank line:

$ docker run -p 8080:80 --detach --name httpd jessews/cern-httpd:history -v
1c58a675f204b5f74580844eddcfc9cf740ea333590ae5551ceab4665445ac23
$ telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0

HTTP/1.0 200 Document follows
Server: CERN/3.0A
Date: Mon, 09 Mar 2026 20:27:04 GMT
Content-Type: text/html
Content-Length: 2187
Last-Modified: Fri, 25 Dec 2020 03:56:35 GMT

<TITLE>CERN httpd</TITLE>

<H1>This webpage is being served to you by version 3.0A of the <A HREF=http://en.wikipedia.org/wiki/CERN_httpd>CERN httpd</A>.</H1>

The CERN httpd (HTTP daemon), initially released in June 1991, was the first <A HREF=http://en.wikipedia.org/wiki/Web_server>web server</A> software. Version 3.0A was the final version of the software, released in July 1996. The CERN httpd was developed starting in 1990 by <A HREF=http://en.wikipedia.org/wiki/Tim_Berners-Lee>Tim Berners-Lee</A>, later joined by <A HREF=http://www.w3.org/People.html#Luotonen>Ari Luotonen</A> and <A HREF=http://en.wikipedia.org/wiki/Henrik_Frystyk_Nielsen>Henrik Frystyk Nielsen</A>.<P>

The <A HREF=/hypertext>/hypertext</A> directory on this server contains a 1992 partial snapshot of <A HREF=http://info.cern.ch>http://info.cern.ch</A>, the first WWW site. This snapshot was obtained from the <A HREF=http://www.w3.org/History/19921103-hypertext/hypertext>W3C Historical Archives</A>, and has been merged with additional contents from the CERN httpd 3.0A distribution archive in order to fix some broken links. "<A HREF=/hypertext/WWW/TheProject.html>The World Wide Web project</A>" is a good page to start browsing from.<P>

The particular server hosting this page is a <A HREF=http://hub.docker.com/r/jessews/cern-httpd>containerized instance</A> of the 3.0A httpd, assembled in 2020 -- 30 years after Tim Berners-Lee began development on the software. Only <A HREF=http://github.com/okofish/cern-httpd-docker/blob/master/httpd-patches.patch>three lines</A> in the 1996 code were changed, in order for the software to compile in a modern Linux environment.<P>

A command-line HTTP client such as <A HREF=http://curl.se>curl</A> can be used to inspect the headers sent by this server. Note the "Server: CERN/3.0A" header, the "<A HREF=http://tools.ietf.org/html/rfc1945>HTTP/1.0</A>" version, and the nonstandard "Document follows" reason phrase after the 200 status code:
<XMP>
$ curl -I http://this.host
HTTP/1.0 200 Document follows
Server: CERN/3.0A
Date: Sun, 13 Dec 2020 21:54:20 GMT
Content-Type: text/html
Content-Length: 2367
Last-Modified: Sun, 13 Dec 2020 21:47:42 GMT

</XMP>Connection closed by foreign host.
$ docker exec httpd xxd /srv/www/Welcome.html | head -n 10
00000000: 3c54 4954 4c45 3e43 4552 4e20 6874 7470  <TITLE>CERN http
00000010: 643c 2f54 4954 4c45 3e0a 0a3c 4831 3e54  d</TITLE>..<H1>T
00000020: 6869 7320 7765 6270 6167 6520 6973 2062  his webpage is b
00000030: 6569 6e67 2073 6572 7665 6420 746f 2079  eing served to y
00000040: 6f75 2062 7920 7665 7273 696f 6e20 332e  ou by version 3.
00000050: 3041 206f 6620 7468 6520 3c41 2048 5245  0A of the <A HRE
00000060: 463d 6874 7470 3a2f 2f65 6e2e 7769 6b69  F=http://en.wiki
00000070: 7065 6469 612e 6f72 672f 7769 6b69 2f43  pedia.org/wiki/C
00000080: 4552 4e5f 6874 7470 643e 4345 524e 2068  ERN_httpd>CERN h
00000090: 7474 7064 3c2f 413e 2e3c 2f48 313e 0a0a  ttpd</A>.</H1>..

I also looked at the source code and it seems to be handled here: https://github.com/emanueleg/cern-httpd/blob/a464a7908cd925f3ec3d0a0769454958f149c42e/Daemon/Implementation/HTRequest.c#L445

@github-actions
Copy link
Contributor

Preview URLs (1 page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTTP HTTP docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants