Opened 4 months ago

Closed 3 months ago

#6849 closed enhancement (fixed)

Use of CSW service that requires POST REDIR

Reported by: gbernard Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 2.1.3
Severity: normal Keywords:
Cc:

Description

Presently when a service requires a redirection, the POST request is turned into a GET request after the redirection which can be a problem. I found out that adding the CURLOPT_POSTDIR option with the value CURL_REDIR_POST_ALL fix my issue (cpl_http.cpp line 600). This option instruct curl to retain the POST command after following a redirection. Would it make sense to add this option permanently ?

Attachments (1)

gdal-post-redir.patch (583 bytes) - added by gbernard 3 months ago.
Patch adding the CURLOPT_POSTREDIR.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 3 months ago by Even Rouault

Would it make sense to add this option permanently ?

Probably. Seems weir that POST gets turned into GET after redirection. Can you propose a patch ?

Changed 3 months ago by gbernard

Attachment: gdal-post-redir.patch added

Patch adding the CURLOPT_POSTREDIR.

comment:2 Changed 3 months ago by gbernard

I've added the very simple patch.

comment:3 Changed 3 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 37970:

CPLHTTPSetOptions(): make redirection of POST requests to still be POST requests after redirection (patch by gbernard, fixes #6849)

Note: See TracTickets for help on using tickets.