Skip to content

Commit 187f872

Browse files
committed
Print out response header as well
1 parent 20e5261 commit 187f872

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

misc/dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ corge
1616
coverity
1717
cpack
1818
cpus
19+
CURLH
1920
DBUILD
2021
dbus
2122
dearmor

modules/ggl-http/src/gghttp.c

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "ggl/http.h"
99
#include "ggl/object.h"
1010
#include <assert.h>
11+
#include <curl/curl.h>
1112
#include <ggl/buffer.h>
1213
#include <ggl/log.h>
1314
#include <ggl/vector.h>
@@ -153,6 +154,17 @@ GglError sigv4_download(
153154
curl_easy_getinfo(curl_data.curl, CURLINFO_HTTP_CODE, &http_status_code);
154155
GGL_LOGD("Return HTTP code: %ld", http_status_code);
155156

157+
struct curl_header *type = NULL;
158+
curl_easy_header(
159+
curl_data.curl, "Content-Type", 0, CURLH_HEADER, -1, &type
160+
);
161+
162+
if (type) {
163+
GGL_LOGT("Response header content: %s", type->value);
164+
} else {
165+
GGL_LOGT("Response header content: is empty");
166+
}
167+
156168
gghttplib_destroy_curl(&curl_data);
157169

158170
return error;

0 commit comments

Comments
 (0)