<p dir="ltr"><br>
On Jul 1, 2015 11:18 PM, "Durham Goode" <<a href="mailto:durham@fb.com">durham@fb.com</a>> wrote:<br>
><br>
> Series looks good.  I'll push it.<br>
><br>
> Only change I made is that you use get-with-headers in the tests, but it doesn't exist in remotefilelog/tests.  I'm guessing you're running with the upstream run-tests.py?  I'll just add that file to tests/</p>
<p dir="ltr">Oh, yup. Was using the one from upstream so I could iterate on wireproto silliness. Thanks!</p>
<p dir="ltr">><br>
><br>
> On 7/1/15 1:05 PM, Augie Fackler wrote:<br>
>><br>
>> # HG changeset patch<br>
>> # User Augie Fackler <<a href="mailto:augie@google.com">augie@google.com</a>><br>
>> # Date 1435676687 14400<br>
>> #      Tue Jun 30 11:04:47 2015 -0400<br>
>> # Node ID f4d310b5f7fc0213ec07435802e594b807b260f4<br>
>> # Parent  99e8e62032be03b27e450cfb261a5cd61a960360<br>
>> remotefilelogserver: prevent getfiles from being called over http at all<br>
>><br>
>> This means that even old clients that fail to sniff for capabilities<br>
>> before trying getfiles will get a sensible error message back from the<br>
>> server.<br>
>><br>
>> diff --git a/remotefilelog/remotefilelogserver.py b/remotefilelog/remotefilelogserver.py<br>
>> --- a/remotefilelog/remotefilelogserver.py<br>
>> +++ b/remotefilelog/remotefilelogserver.py<br>
>> @@ -8,6 +8,7 @@<br>
>>   from mercurial import wireproto, changegroup, match, util, changelog, context<br>
>>   from mercurial import exchange, sshserver<br>
>>   from mercurial.extensions import wrapfunction<br>
>> +from mercurial.hgweb import protocol as httpprotocol<br>
>>   from mercurial.node import bin, hex, nullid, nullrev<br>
>>   from mercurial.i18n import _<br>
>>   import shallowrepo<br>
>> @@ -170,6 +171,13 @@ def onetimesetup(ui):<br>
>>         wrapfunction(context.basefilectx, '_adjustlinkrev', _adjustlinkrev)<br>
>>   +    def _iscmd(orig, cmd):<br>
>> +        if cmd == 'getfiles':<br>
>> +            return False<br>
>> +        return orig(cmd)<br>
>> +<br>
>> +    wrapfunction(httpprotocol, 'iscmd', _iscmd)<br>
>> +<br>
>>   def getfiles(repo, proto):<br>
>>       """A server api for requesting particular versions of particular files.<br>
>>       """<br>
>> diff --git a/tests/test-http.t b/tests/test-http.t<br>
>> --- a/tests/test-http.t<br>
>> +++ b/tests/test-http.t<br>
>> @@ -31,6 +31,5 @@ as the getfile method it offers doesn't<br>
>>       $ get-with-headers.py localhost:$HGPORT '?cmd=this-command-does-not-exist' | head -n 1<br>
>>     400 no such method: this-command-does-not-exist<br>
>> -Bug: this should return 400, not 5xx<br>
>>     $ get-with-headers.py localhost:$HGPORT '?cmd=getfiles' | head -n 1<br>
>> -  500 Internal Server Error<br>
>> +  400 no such method: getfiles<br>
><br>
><br>
</p>