headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.49k stars 160 forks source link

Change to use bow.state.Response.Request.URL in Url() #18

Closed lestrrat closed 9 years ago

lestrrat commented 9 years ago

Prefer to use bow.state.Response.URL, because in case of redirects, the current context depends on the final Request.

A concrete example would be something like OAuth flow, where you access host A which delegates to host B to do the authorization via a redirect. If you don't use the Response URL, then the next Form object may resolve its URL in the context of host A, not B

headzoo commented 9 years ago

This has been merged into dev, which I'll merge into master later today. Thanks for the contribution, and thank you for taking the time to write a test for your changes.