change handler mount point to /proxy/http/
License: MIT Signed-off-by: Ian Preston <ianopolous@protonmail.com>
Dr Ian Preston committed
Oct 2, 2018 at 00:42 UTC
22f3b11621cea0ef4f9617c53f8e05da3ab49e56
2 files changed
+2
-6
core/corehttp/proxy.go
+1
-5
@@ -15,7 +15,7 @@ import (
15
16
func ProxyOption() ServeOption {
17
return func(ipfsNode *core.IpfsNode, _ net.Listener, mux *http.ServeMux) (*http.ServeMux, error) {
18
- mux.HandleFunc("/proxy/", func(w http.ResponseWriter, request *http.Request) {
18
+ mux.HandleFunc("/proxy/http/", func(w http.ResponseWriter, request *http.Request) {
19
// parse request
20
parsedRequest, err := parseRequest(request)
21
if err != nil {
@@ -73,10 +73,6 @@ func parseRequest(request *http.Request) (*proxyRequest, error) {
73
return nil, fmt.Errorf("Invalid request path '%s'", path)
74
}
75
76
- if split[2] != "http" {
77
- return nil, fmt.Errorf("Invalid proxy request protocol '%s'", split[2])
78
- }
79
-
76
peerID, err := peer.IDB58Decode(split[3])
77
78
if err != nil {
test/sharness/t0184-http-proxy-over-p2p.sh
+1
-1
@@ -138,7 +138,7 @@ teardown_sender_and_receiver
138
test_expect_success 'handle proxy http request invalid request' '
139
setup_receiver_ipfs &&
140
setup_sender_ipfs &&
141
-curl_check_response_code 400 DERPDERPDERP
141
+curl_check_response_code 404 DERPDERPDERP
142
'
143
teardown_sender_and_receiver
144