[Twisted-Python] Final request URI from an Agent response
jonathan+twisted at jsphere.com
Fri Mar 15 07:11:07 EDT 2013
I'm interested in working on ticket #5435: The ability to discover the final URI of an Agent request/response. Thomas summarised a previous IRC conversation on this topic quite well in a comment on the ticket .
The biggest issue I've encountered so far is that Request.uri is a relative URI. Since it is not possible to reconstruct an absolute URI given the information that Request has, at the very least the URI scheme is lost, we have a few options:
* Allow Request.uri to be either an absolute URI or a relative URI byte string, however this means that consumers of this attribute need to be aware that it could be either;
* Add a new attribute/method to Request (and parameter to Request.__init__) for the absolute URI, again this means that consumers need to be aware that the absolute URI might not be present.
If we are to change Request's URI API, it would be a good idea to do this as few times as possible. (One seems like a good number to me.)
JP commented that it would be nice if there was an object that represented a URL we could use, referring to ticket #5388. And although I would love to see #5388 finished (and might even be persuaded to work on it), discussions with Itamar and reading ticket comments have left me weary of the many nuanced complexities of this task.
What are the thoughts on changing the meaning of Request.uri?
Should the IRI branch be finished before attempting this ticket? (Note that this doesn't necessarily include my volunteering.)
More information about the Twisted-Python