Skip to content

Commit

Permalink
change handler mount point to /proxy/http/
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Ian Preston <ianopolous@protonmail.com>
  • Loading branch information
ianopolous committed Oct 2, 2018
1 parent 2c91cb6 commit 5d20453
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions core/corehttp/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func ProxyOption() ServeOption {
return func(ipfsNode *core.IpfsNode, _ net.Listener, mux *http.ServeMux) (*http.ServeMux, error) {
mux.HandleFunc("/proxy/", func(w http.ResponseWriter, request *http.Request) {
mux.HandleFunc("/proxy/http/", func(w http.ResponseWriter, request *http.Request) {
// parse request
parsedRequest, err := parseRequest(request)
if err != nil {
Expand Down Expand Up @@ -73,10 +73,6 @@ func parseRequest(request *http.Request) (*proxyRequest, error) {
return nil, fmt.Errorf("Invalid request path '%s'", path)
}

if split[2] != "http" {
return nil, fmt.Errorf("Invalid proxy request protocol '%s'", split[2])
}

peerID, err := peer.IDB58Decode(split[3])

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0184-http-proxy-over-p2p.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ teardown_sender_and_receiver
test_expect_success 'handle proxy http request invalid request' '
setup_receiver_ipfs &&
setup_sender_ipfs &&
curl_check_response_code 400 DERPDERPDERP
curl_check_response_code 404 DERPDERPDERP
'
teardown_sender_and_receiver

Expand Down

0 comments on commit 5d20453

Please sign in to comment.