CrowdHailer / raxx

Interface for HTTP webservers, frameworks and clients
https://hexdocs.pm/raxx
Apache License 2.0
401 stars 29 forks source link

Raxx.set_body should set the content length. #127

Closed CrowdHailer closed 5 years ago

CrowdHailer commented 5 years ago

Rational

This is because it will be added when serializing. The content-length header is left on the request/response when parsed. as much as possible the parsed request should equal the original request.

implementation.

The aim is to have as few special cases as possible, i.e. treat most headers the same way. However content length is important for every request.

For that reason I think we should add the function Raxx.set_content_length(message, non_neg_integer and one to get/fetch the content length.

set_body can then make use of set_content_length.

Checklist

CrowdHailer commented 5 years ago

Done on master, will be part of 0.16.0