[PATCH] httppeer: make sure we limit argument for older server not supporting batch

Martin von Zweigbergk martinvonz at google.com
Thu Apr 25 00:03:32 EDT 2019


On Wed, Apr 24, 2019 at 7:25 PM Gregory Szorc <gregory.szorc at gmail.com>
wrote:

> On Wed, Apr 24, 2019 at 12:29 AM Pierre-Yves David <
> pierre-yves.david at ens-lyon.org> wrote:
>
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at octobus.net>
>> # Date 1556049342 -7200
>> #      Tue Apr 23 21:55:42 2019 +0200
>> # Node ID 26f277f0f415206036a57f17400284107816f00d
>> # Parent  84bd6ae2d1f656dff1d494a03558c4edb58ebd31
>> # EXP-Topic discovery-followup
>> # Available At https://bitbucket.org/octobus/mercurial-devel/
>> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
>> 26f277f0f415
>> httppeer: make sure we limit argument for older server not supporting
>> batch
>>
>
I believe this patch was in response to a question from me. I was asking if
'httppostargs' automatically upgraded the HTTP method from GET to POST and
I thought it did not and that we relied on the use of the 'batch' request
for that (which always used POST, I think). Joerg then replied that
'httppostargs' does upgrade from GET to POST, so I think this patch is not
needed. Do you (both Greg and Pierre-Yves) agree?


> Queued.
>
>
>>
>> Most commands will still have some argument restriction when using 'GET'
>> method
>> instead of batching through POST.
>>
>> diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
>> --- a/mercurial/httppeer.py
>> +++ b/mercurial/httppeer.py
>> @@ -382,7 +382,9 @@ class httppeer(wireprotov1peer.wirepeer)
>>          self._path = path
>>          self._url = url
>>          self._caps = caps
>> -        self.limitedarguments = caps is not None and 'httppostargs' not
>> in caps
>> +        self.limitedarguments = False
>> +        if caps is None or 'batch' not in caps or 'httppostargs' not in
>> caps:
>> +            self.limitedarguments = True
>>          self._urlopener = opener
>>          self._requestbuilder = requestbuilder
>>
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20190424/71e92f56/attachment.html>


More information about the Mercurial-devel mailing list