slogsdon / elixir-reverse-proxy

A Plug based, reverse proxy server written in Elixir.
https://hex.pm/packages/reverse_proxy
MIT License
147 stars 34 forks source link

Handle partial bodies #7

Closed tt closed 7 years ago

tt commented 7 years ago

Plug.Conn.read_body will by default read 8,000,000 bytes. If the body is larger, it results in an error as the return signature doesn't match.

This reads 8,000,000 bytes as many times as necessary and use a stream implementation as is already the format accepted by HTTPoison. This might break with other HTTP clients but it's not really a breaking change and those would already be broken for bodies this large (and bodies below the default is not handled any differently).

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 97.297% when pulling c10242d6c97f7048d2b8124e139421c34ccd4155 on tt:handle-partial-bodies into cc25ae9b399782f549c4af89b5197976c09b6122 on slogsdon:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 97.297% when pulling c10242d6c97f7048d2b8124e139421c34ccd4155 on tt:handle-partial-bodies into cc25ae9b399782f549c4af89b5197976c09b6122 on slogsdon:master.

slogsdon commented 7 years ago

Thanks, @tt! I'll get a new release pushed out to Hex with this and your other PR tonight.