Skip to content

Commit

Permalink
MINOR FIXES
Browse files Browse the repository at this point in the history
    - Start testing PG16
    - Fix content_type shadowing
  • Loading branch information
robe2 committed Jul 31, 2023
1 parent 03b94dd commit 887f0b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- { PGVER: 13 }
- { PGVER: 14 }
- { PGVER: 15 }
- { PGVER: 16 }

steps:

Expand Down
8 changes: 4 additions & 4 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,18 +1161,18 @@ Datum http_request(PG_FUNCTION_ARGS)
{
text *content_text;
long content_size;
char *content_type;
char *content_type_2;
char buffer[1024];

/* Read the content type */
if ( nulls[REQ_CONTENT_TYPE] || ! values[REQ_CONTENT_TYPE] )
elog(ERROR, "http_request.content_type is NULL");
content_type = TextDatumGetCString(values[REQ_CONTENT_TYPE]);
content_type_2 = TextDatumGetCString(values[REQ_CONTENT_TYPE]);

/* Add content type to the headers */
snprintf(buffer, sizeof(buffer), "Content-Type: %s", content_type);
snprintf(buffer, sizeof(buffer), "Content-Type: %s", content_type_2);
headers = curl_slist_append(headers, buffer);
pfree(content_type);
pfree(content_type_2);

/* Read the content */
content_text = DatumGetTextP(values[REQ_CONTENT]);
Expand Down

0 comments on commit 887f0b2

Please sign in to comment.