Re: Rest-API hanging on DELETE and OPTIONS not supported.

Ralf Schlatterbeck <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
On Sat, Feb 02, 2019 at 03:36:33PM -0500, John P. Rouillard wrote:
> However with this patch it brings up a new issue.  Trying to use the
> new OPTIONS verb support or the DELETE or PATCH verbs hang. E.G.
> 
>     curl -vv -X DELETE -u admin -p --header 'Accept: application/json' \
>         'https://rouilj.dynamic-dns.net/demo/rest/data/issue/22'
> 
> hangs and never comes back. The logs from the roundup-server instance report:
> 
>    127.0.0.1 - - [02/Feb/2019 15:05:39] timeout
> 
> I should see:
> 
>   {"data": {"status": "ok"}}
> 
> returned from curl.
...
> I tracked the hang to the standard cgi.py python module in the
> FieldStorage.__init__ method. The read_single() method gets called and
> hangs forever since there is no data to read. I think it is trying to
> read data as though the verb was POST. It looks like any verb other
> than GET is treated like POST and tries to read data even if there is
> no data.

I *think* this might be due to your testing framework keeping open the
http connection (for the next request).
I had a similar issue when testing the REST patches using the python
requests library: I originally used GET parameters when testing DELETE
and PATCH which didn't work (but returned no parameters and did not
hang, presumably because I didn't keep the connection open).

I think the patch is fine although I'm not sure we should be accepting
GET-like parameters for PATCH and DELETE.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.