PATCH: set User-Agent string in HTTP transport
James Henstridge
james.henstridge at gmail.com
Mon Feb 6 07:43:22 GMT 2006
On 06/02/06, Robert Collins <robertc at robertcollins.net> wrote:
> Thanks James. We actually have all the machinery to do that already in
> bzrlib.transport.http.HttpServer - it should be a simple matter (i.e.
> using 'TestCaseWithHTTPServer' which already exists) to use that in
> writing the test - i.e. by having it log the user agent as one of the
> fields in the log of the request. I think this would be better than a
> whole new server-in-a-thread implementation.
Good point. I've updated the test (attached) to use this approach.
There was already a TestCaseWithWebserver in
bzrlib.tests.HTTPTestUtil, so I used that.
I also simplified the HttpServer initialisation code a little to let
the OS allocate the port number rather than sequentially trying a
range of ports to bind to. This should be a bit more robust than the
existing code.
James.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-user-agent-test.patch
Type: text/x-patch
Size: 3968 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060206/d69309ef/attachment.bin
More information about the bazaar
mailing list