Merge lp:~jpds/launchpad/fix_565345-mirror-prober-agent into lp:launchpad
Proposed by
Jonathan Davies
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 10747 |
Proposed branch: | lp:~jpds/launchpad/fix_565345-mirror-prober-agent |
Merge into: | lp:launchpad |
Diff against target: |
60 lines (+23/-2) 2 files modified
lib/lp/registry/scripts/distributionmirror_prober.py (+2/-0) lib/lp/registry/tests/test_distributionmirror_prober.py (+21/-2) |
To merge this branch: | bzr merge lp:~jpds/launchpad/fix_565345-mirror-prober-agent |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | code | Approve | |
Review via email: mp+23708@code.launchpad.net |
Commit message
Added "User-Agent" header to the mirror prober.
Description of the change
= Summary =
This branch adds a "User-Agent" header to the mirror prober so that probes can be identified easily in HTTPd logs.
To post a comment you must log in.
A good idea, especially since we've traditionally asked bots accessing our site to provide meaningful user agent identification. Shouldn't ours include a URL as well, by the way?
It's a shame you have to mess with sendHeader in this way, but the only alternative I see is to make FakeTransport log its header and that's probably more effort than it's worth.
A few points remain though: ls(...) ; just invoke it. It'll raise an exception if it fails. 'User-Agent' ]?
* Don't return self.assertEqua
* Don't test "headers[1]"—a hard-coded index is far too fragile. Why not make "headers" a dict and test headers[
Jeroen