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

Re: [tor-bugs] #25472 [Obfuscation/Snowflake]: snowflake-client's `-url` option is intolerant of a missing path (was: snowflake-client's `-url` option is intolerant of a missing trailing slash.)



#25472: snowflake-client's `-url` option is intolerant of a missing path
-----------------------------------+------------------------------
 Reporter:  dcf                    |          Owner:  (none)
     Type:  defect                 |         Status:  needs_review
 Priority:  Medium                 |      Milestone:
Component:  Obfuscation/Snowflake  |        Version:
 Severity:  Minor                  |     Resolution:
 Keywords:  easy                   |  Actual Points:
Parent ID:                         |         Points:
 Reviewer:                         |        Sponsor:
-----------------------------------+------------------------------
Changes (by dcf):

 * status:  new => needs_review


Comment:

 Here is a patch. It uses the net.url
 [https://golang.org/pkg/net/url/#URL.ResolveReference ResolveReference]
 function to construct a new URL whose that is the same as a base URL,
 except with a different path. This works for the no-path case (e.g.
 `http://127.0.0.1:8080`), and also for the case when the base URL has a
 path other than `/`, e.g. `https://philanthropic.example/snowflake/`. The
 latter example would cause client POSTS to go to
 `https://philanthropic.example/snowflake/client`.

 The way we're going it already in proxy-go is similar, except we're
 clobbering the path, rather than resolving it relatively:
   https://gitweb.torproject.org/pluggable-transports/snowflake.git/tree
 /proxy-go/snowflake.go?id=ff8f3851082e8f7f8b4c8b99b161be35020aeb67#n134
 {{{
         broker := mustParseURL(brokerURL)
         broker.Path = "/proxy"
 }}}
   https://gitweb.torproject.org/pluggable-transports/snowflake.git/tree
 /proxy-go/snowflake.go?id=ff8f3851082e8f7f8b4c8b99b161be35020aeb67#n159
 {{{
         broker := mustParseURL(brokerURL)
         broker.Path = "/answer"
 }}}
 If the patch looks good, I think we should change proxy-go to use
 ResolveReference as well, because it avoids having to repeatedly re-parse
 `brokerURL`, and allows the base URL to have a path, as in the example
 above.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25472#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs