Merge pull request #5858 from paritytech/mh-ipfs-allow-post

Allow IPFS server to accept POST requests
This commit is contained in:
Robert Habermeier 2017-06-16 18:46:53 +02:00 committed by GitHub
commit d6a0792bd9
1 changed files with 3 additions and 3 deletions

View File

@ -77,11 +77,11 @@ impl IpfsHandler {
/// Implement Hyper's HTTP handler
impl Handler<HttpStream> for IpfsHandler {
fn on_request(&mut self, req: Request<HttpStream>) -> Next {
if *req.method() != Method::Get {
return Next::write();
match *req.method() {
Method::Get | Method::Post => {},
_ => return Next::write()
}
if !http::is_host_allowed(&req, &self.allowed_hosts) {
self.out = Out::Bad("Disallowed Host header");