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

Handle additional characters in headers #1

Open
mpchadwick opened this issue Feb 23, 2017 · 0 comments
Open

Handle additional characters in headers #1

mpchadwick opened this issue Feb 23, 2017 · 0 comments
Labels

Comments

@mpchadwick
Copy link
Owner

Currently we only count the size of the key and value in the headers.

static int gather_header_size(void *b_, const char *key, const char *value)
{
int *b = b_;
(*b) += strlen(key);
(*b) += strlen(value);
return 1;
}

Typically a line looks like this

Key: Value

It has 4 additional bytes...

  • The colon after the key
  • The space after the colon
  • A CLRF at the end of the line

After the final line there is an additional line with only a CLRF before the body starts. Based on the HTTP spec I don't think this is part of the headers

Request (section 5) and Response (section 6) messages use the generic message format of RFC 822 [9] for transferring entities (the payload of the message). Both types of message consist of a start-line, zero or more header fields (also known as "headers"), an empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields, and possibly a message-body.

https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4

@mpchadwick mpchadwick added the bug label Feb 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant