Closed
Description
After PR #93 is merged, we'll have changed the "Subscribe" header from 3 variants:
Subscribe
or Subscribe: keep-alive
or Subscribe: keep-alive=<seconds>
to a single variant:
Subscribe
I like this simplifying change quite a bit; however, this carries several issues forward and introduces some new ones.
- I don't think "Subscribe" (i.e. without a colon, ":") is a spec-compliant header. According to the HTTP 1.1 spec, RFC 2616 p. 31, "HTTP Header Fields...follow the same generic format as that given in Section 3.1 of RFC 822 [9]. Each header field consists of a name followed by a colon (":") and the field value." RFC 822 Section 3.1.2 also specifies "Once a field has been unfolded, it may be viewed as being composed of a field-name followed by a colon (":"), followed by a field-body, and terminated by a carriage-return/line-feed."
- Spec-conformance aside, it's clear that common tools such as
curl
expect headers to have a colon and value.
For example, neither curl -H Subscribe
nor curl -H Subscribe:
will successfully pass "Subscribe" as a request header, but "Subscribe:keep-alive" is passed as a header:
# "Subscribe" with no colon:
$ curl -vH Subscribe https://invisible.college:4545/posts
> GET /posts HTTP/1.1
> Host: invisible.college:4545
> User-Agent: curl/7.54.0
> Accept: */*
>
...
# "Subscribe" with colon but no value:
$ curl -vH Subscribe: https://invisible.college:4545/posts
> GET /posts HTTP/1.1
> Host: invisible.college:4545
> User-Agent: curl/7.54.0
> Accept: */*
>
...
# "Subscribe" with colon and value:
$ curl -vH Subscribe:keep-alive https://invisible.college:4545/posts
> GET /posts HTTP/1.1
> Host: invisible.college:4545
> User-Agent: curl/7.54.0
> Accept: */*
> Subscribe:keep-alive <----- SUCCESS
>
...
- Finally, if we reduce 3 variants to a single variant, but a header value is required, what should it be? "On", "Yes", "True" etc.?
Metadata
Metadata
Assignees
Labels
No labels