[MERGE] squid proxies use boundary="foo"

John Arbash Meinel john at arbash-meinel.com
Fri Sep 1 04:40:56 BST 2006


Martin Pool wrote:
> On  1 Sep 2006, Michael Ellerman <michael at ellerman.id.au> wrote:
>>> This adds another explicit response text to the test suite, and makes
>>> sure that we handle the "" properly.
>> Nice catch.
> 
> mpe, feel free to vote +1 if you've read the patch.  +1 from me anyhow.
> 
>> 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*$')
> 
> That doesn't insist that the quotes be matched, but otherwise it seems
> cleaner.  You could do that with something like
> 
>   ("?)(.*[^"])\1

Because when I tried it as:
(")?(.*?)\1

It broke. :) I guess my grouping was wrong, since the ("?) ends up being
the empty group, and (")? ends up being something else.

Anyway, if you prefer the regex match, I'm okay with that. It was a
little bit more understandable as a separate check.

Wait a sec. We don't have the raw prefix (r')
So we are lucky that the above worked at all.
The issue is that \s doesn't mean anything to python, so it leaves the
literal \s in there., but if you get too fancy, then it will break,
because it is double escaping the '\'. So at the very least we need:
r'^\s*multipart/byteranges\s*;\s*boundary\s*=\s*'...

Anyway, I'll get it cleaned up tomorrow.

John
=:->

> 
> (Not tested.)  This says if there's an initial quote, there must be a
> trailing quote.
> 
> Why do we have the odd construction (.*?) ?  Surely the '?' is
> redundant?
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060831/d7748ea4/attachment.pgp 


More information about the bazaar mailing list