Merge lp:~gary/launchpad/bug676489 into lp:launchpad
Proposed by
Gary Poster
Status: | Merged |
---|---|
Approved by: | Gary Poster |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11935 |
Proposed branch: | lp:~gary/launchpad/bug676489 |
Merge into: | lp:launchpad |
Diff against target: |
79 lines (+43/-7) 2 files modified
lib/lp/services/apachelogparser/base.py (+13/-7) lib/lp/services/apachelogparser/tests/test_apachelogparser.py (+30/-0) |
To merge this branch: | bzr merge lp:~gary/launchpad/bug676489 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Edwin Grubbs (community) | code | Approve | |
Benji York (community) | code* | Approve | |
Review via email: mp+41069@code.launchpad.net |
Commit message
[r=benji,
Description of the change
This change fixes bug 676489 by adding code to handle a space in the path. I added tests for these changes, as well as for an existing code path pertinent to HTTP 1.0 possibly not including the protocol.
To run all the pertinent tests I know about, run ``./bin/test -vvt test_apachelogp
``make lint`` is happy.
Thank you.
To post a comment you must log in.
This branch looks good. Edwin, my mentor, will also be reviewing it
momentarily.
I especially appreciate the thorough test coverage.
A small comment about this bit of code:
path, ignore, protocol = rest.rpartition(' ')
if not path:
# HTTP 1.0 requests might omit the HTTP version so we cope with them.
path = protocol
On first reading I'd expect the body of the if to assign a new value to
"protocol" as well (perhaps None).
On second reading I realize that protocol isn't used (other than if it
isn't actually the protocol) and wonder if restraining from naming the
strings until they're known-good might be better:
# HTTP 1.0 requests might omit the HTTP version so we cope with them.
first, ignore, last = rest.partition(' ')
if first:
path = first
else:
path = last
Or even the shorter but perhaps obscure:
# HTTP 1.0 requests might omit the HTTP version so we cope with them.
first, ignore, last = rest.partition(' ')
path = first or last