Skip to content

Commit

Permalink
change handler mount point to /proxy/http/
Browse files Browse the repository at this point in the history
Licence: MIT
Signed-off-by: Ian Preston ianopolous@protonmail.com
  • Loading branch information
ianopolous committed Oct 2, 2018
1 parent 2c91cb6 commit 60092b8
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

1 comment on commit 60092b8

@GitCop
Copy link

@GitCop GitCop commented on 60092b8 Oct 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were the following issues with your Pull Request

We ask for a few features in the commit message for Open Source licensing hygiene and commit message clarity.
git commit --amend can often help you quickly improve the commit message.
Guidelines and a script are available to help in the long run.
Your feedback on GitCop is welcome on this issue.


This message was auto-generated by https://gitcop.com

Please sign in to comment.