-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SUPPORT unknown types #163
Conversation
- Define a new thing called HTTP_UNKNOWN - If doesn't fit our defined set of methods, mark as HTTP_UNKNOWN and pass the method type thru to curl unchanged - Get rid of http_method domain standard type enforcement Closes pramsey#159
http.c
Outdated
@@ -1206,6 +1207,11 @@ Datum http_request(PG_FUNCTION_ARGS) | |||
CURL_SETOPT(g_http_handle, CURLOPT_READDATA, &si_read); | |||
CURL_SETOPT(g_http_handle, CURLOPT_INFILESIZE, content_size); | |||
} | |||
else if (method == HTTP_UNKNOWN) | |||
{ | |||
/** assume the user knows what they are doing and pass unchanged **/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the double **
in the comment.
@@ -1078,8 +1079,8 @@ Datum http_request(PG_FUNCTION_ARGS) | |||
elog(ERROR, "http_request.method is NULL"); | |||
method_str = TextDatumGetCString(values[REQ_METHOD]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry seeing this just in the patch w/o context, want to confirm we have a null check?
http.c
Outdated
elog(DEBUG2, "pgsql-http: method '%s'", method_str); | ||
pfree(method_str); | ||
elog(DEBUG2, "pgsql-http: method_str '%s'", method_str); | ||
elog(DEBUG2, "pgsql-http: method '%d'", method); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crunch it down to one debug line.
http.c
Outdated
@@ -1225,7 +1231,12 @@ Datum http_request(PG_FUNCTION_ARGS) | |||
/* If we had a content we do not reach that part */ | |||
elog(ERROR, "http_request.content is NULL"); | |||
} | |||
else if ( method == HTTP_UNKNOWN ){ | |||
/** assume the user knows what they are doing and pass unchanged **/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* this is fine */
Closes #159