[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake/master] Use ResolveReference to construct the /client URL.



commit c61336c897b5d21cc94a21241e98b33df5dcbf78
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Mon Mar 12 20:28:01 2018 -0700

    Use ResolveReference to construct the /client URL.
    
    This way works when the base URL lacks a path, e.g.
    "http://127.0.0.1:8080";.
    https://bugs.torproject.org/25472
---
 client/rendezvous.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/client/rendezvous.go b/client/rendezvous.go
index 0aed3f7..cab7f5a 100644
--- a/client/rendezvous.go
+++ b/client/rendezvous.go
@@ -80,7 +80,8 @@ func (bc *BrokerChannel) Negotiate(offer *webrtc.SessionDescription) (
 		bc.Host, "\nFront URL:  ", bc.url.Host)
 	data := bytes.NewReader([]byte(offer.Serialize()))
 	// Suffix with broker's client registration handler.
-	request, err := http.NewRequest("POST", bc.url.String()+"client", data)
+	clientURL := bc.url.ResolveReference(&url.URL{Path: "client"})
+	request, err := http.NewRequest("POST", clientURL.String(), data)
 	if nil != err {
 		return nil, err
 	}

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits