[weboob] [PATCH 1/1] new module openedx

Laurent Bachelier laurent at bachelier.name
Wed Feb 17 11:02:56 CET 2016


On 2016-02-17 10:28, Simon Lipp wrote:
> I see that there’s already such a match method in URL, but I’m not
> exactly sure how req.url and URL.match works with baseurl. Looks like
> URL.match always try to prepend a base url ; but I’m unsure if req.url
> is guaranteed to always be a full url (domain + path + query-string) or
> can sometimes be just a path.


If you use DomainBrowser or PagesBrowser, the open() method will always
prepend the base URL before calling prepare_request(), unless the URL is
already absolute.

In other cases, just call url = self.absurl(url) to make sure.

If you use "params", which I think is used by requests to build a query
string, it won't be in the URL though. But as long as you build the URL
with the URL class everything should be fine.



More information about the weboob mailing list