From 649de53382de1c50e84512333146617c17cef092 Mon Sep 17 00:00:00 2001 From: maciejhirsz Date: Fri, 16 Jun 2017 16:29:15 +0200 Subject: [PATCH] Allow IPFS server to accept POST requests --- ipfs/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipfs/src/lib.rs b/ipfs/src/lib.rs index eeac2431b..104c7db19 100644 --- a/ipfs/src/lib.rs +++ b/ipfs/src/lib.rs @@ -77,11 +77,11 @@ impl IpfsHandler { /// Implement Hyper's HTTP handler impl Handler for IpfsHandler { fn on_request(&mut self, req: Request) -> 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");