[MERGE] squid proxies use boundary="foo"
Michael Ellerman
michael at ellerman.id.au
Fri Sep 1 00:55:31 BST 2006
On Thu, 2006-08-31 at 16:40 -0500, John Arbash Meinel wrote:
> https://launchpad.net/products/bzr/+bug/57723
>
> It seems that when going through a squid proxy, squid rewrites the
> multipart boundary sections to something like:
>
> Content-Type: multipart/byteranges;
> boundary="squid/2.6.STABLE1:2F333CDABEAF766ABD9130F8A21BA7E1"
>
> ^^ this should all be on one line
>
> But the important part, is that it is surrounding the real boundary with
> double quotes "".
>
> I didn't see this explicitly allowed by the BNF given here:
> http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
>
> But some of the examples do indeed use double quotes (not all of them do).
>
> I was able to recreate the problem by just installing squid, and then using:
> http_proxy=HTTP_PROXY='http://localhost:3128' \
> bzr get http://bazaar-vcs.org/bzr/bzr.dev
>
> It takes a little while, though, because it has to download all of the
> data before it tries to parse it, and fails to find the indexes.
>
> This adds another explicit response text to the test suite, and makes
> sure that we handle the "" properly.
Nice catch.
> @@ -217,6 +222,9 @@
> "Expected multipart/byteranges with boundary")
>
> boundary = match.group(1)
> + # Remove double quotes around the boundary tag
> + if (boundary.startswith('"') and boundary.endswith('"')):
> + boundary = boundary[1:-1]
> # mutter('multipart boundary is %s', boundary)
> pattern = HttpMultipartRangeResponse._BOUNDARY_PATT
> return re.compile(pattern % re.escape(boundary),
Any reason why you did it this way rather than modifying
CONTENT_TYPE_RE ?
eg.
- '^\s*multipart/byteranges\s*;\s*boundary\s*=\s*(.*?)\s*$')
+ '^\s*multipart/byteranges\s*;\s*boundary\s*=\s*"?(.*?)"?\s*$')
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060901/14c1f1b6/attachment.pgp
More information about the bazaar
mailing list