@@ -1195,22 +1195,22 @@ Datum http_request(PG_FUNCTION_ARGS)
11951195
11961196 CURL_SETOPT (g_http_handle , CURLOPT_POSTFIELDS , text_to_cstring (content_text ));
11971197 }
1198- else if ( method == HTTP_PUT || method == HTTP_PATCH )
1198+ else if ( method == HTTP_PUT || method == HTTP_PATCH || method == HTTP_UNKNOWN )
11991199 {
12001200 if ( method == HTTP_PATCH )
12011201 CURL_SETOPT (g_http_handle , CURLOPT_CUSTOMREQUEST , "PATCH" );
1202+
1203+ /* Assume the user knows what they are doing and pass unchanged */
1204+ if ( method == HTTP_UNKNOWN )
1205+ CURL_SETOPT (g_http_handle , CURLOPT_CUSTOMREQUEST , method_str );
1206+
12021207 initStringInfo (& si_read );
12031208 appendBinaryStringInfo (& si_read , VARDATA (content_text ), content_size );
12041209 CURL_SETOPT (g_http_handle , CURLOPT_UPLOAD , 1 );
12051210 CURL_SETOPT (g_http_handle , CURLOPT_READFUNCTION , http_readback );
12061211 CURL_SETOPT (g_http_handle , CURLOPT_READDATA , & si_read );
12071212 CURL_SETOPT (g_http_handle , CURLOPT_INFILESIZE , content_size );
12081213 }
1209- else if (method == HTTP_UNKNOWN )
1210- {
1211- /* Assume the user knows what they are doing and pass unchanged */
1212- CURL_SETOPT (g_http_handle , CURLOPT_CUSTOMREQUEST , method_str );
1213- }
12141214 else
12151215 {
12161216 /* Never get here */
0 commit comments