Merge lp:~jameinel/loggerhead/remove-head-middleware-758618 into lp:loggerhead

Proposed by John A Meinel
Status: Merged
Merged at revision: 446
Proposed branch: lp:~jameinel/loggerhead/remove-head-middleware-758618
Merge into: lp:loggerhead
Diff against target: 14 lines (+4/-1)
1 file modified
__init__.py (+4/-1)
To merge this branch: bzr merge lp:~jameinel/loggerhead/remove-head-middleware-758618
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+57298@code.launchpad.net

Commit message

[bug=758618] remove HeadMiddleware from the 'bzr serve --http' application stack.

Description of the change

I'm running into bug #758618 doing some local testing. And I don't really want us to see this regression for people running loggerhead trunk.

I don't really feel like digging into why HeadMiddleware is causing this problem, so the quick fix is to just not put it into the application stack.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

Well, it would be nice to fix it properly but I see your point.

Will this have the consequence that HEAD requests will regress to sending the whole body? Perhaps we should reopen the bug for that then?

(approve conditional on reopening the bug if appropriate.)

review: Approve
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/13/2011 03:55 AM, Martin Pool wrote:
> Review: Approve
> Well, it would be nice to fix it properly but I see your point.
>
> Will this have the consequence that HEAD requests will regress to sending the whole body? Perhaps we should reopen the bug for that then?
>
> (approve conditional on reopening the bug if appropriate.)

The HEAD requests we really care about have already been updated.
(Everything that inherits from TemplatedBranchView will not expand the
template.) I think /download would still send body content (because
while it does inherit, it doesn't actually use a Template, it just sends
the raw content as a 'download' attachment.)

For *launchpad* Apache is used as a proxy for Loggerhead, so the public
side already never returns body content for a HEAD request, because
Apache squelches it.

So for small projects that use "bzr serve --http", there are probably a
couple requests that can yield body content for a HEAD request, but I
don't specifically know which ones those would be.

I'm happy to (re)open a bug.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2lUgsACgkQJdeBCYSNAAP2YQCfTSL8W6TvzLjVcWIbHftzzwGc
CFQAmwQHMXg67a5tG2f4itHHI++0OP/L
=1PiY
-----END PGP SIGNATURE-----

Revision history for this message
Martin Pool (mbp) wrote :

I'm not a big fan of bugs saying "there might be a problem with this
for some requests but I don't know which", and I don't think it's
worth trying to find them now. So i'm ok for you to just merge this.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '__init__.py'
--- __init__.py 2011-03-19 08:35:57 +0000
+++ __init__.py 2011-04-12 10:21:32 +0000
@@ -86,7 +86,10 @@
86 config = LoggerheadConfig(argv)86 config = LoggerheadConfig(argv)
87 setup_logging(config, init_logging=False, log_file=sys.stderr)87 setup_logging(config, init_logging=False, log_file=sys.stderr)
88 app = BranchesFromTransportRoot(transport.base, config)88 app = BranchesFromTransportRoot(transport.base, config)
89 app = HeadMiddleware(app)89 # Bug #758618, HeadMiddleware seems to break HTTPExceptionHandler from
90 # actually sending appropriate return codes to the client. Since nobody
91 # desperately needs HeadMiddleware right now, just ignoring it.
92 # app = HeadMiddleware(app)
90 app = HTTPExceptionHandler(app)93 app = HTTPExceptionHandler(app)
91 serve(app, host=host, port=port)94 serve(app, host=host, port=port)
9295

Subscribers

People subscribed via source and target branches