aboutsummaryrefslogtreecommitdiff
path: root/src/download.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/download.c')
-rw-r--r--src/download.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/download.c b/src/download.c
index 74348e5..4154dcb 100644
--- a/src/download.c
+++ b/src/download.c
@@ -18,3 +18,15 @@ int download_to_buffer(const char *url, Buffer *buffer) {
buffer_append(buffer, "\0", 1);
return result;
}
+
+int is_header_response_ok(const char *url) {
+ const char *args[] = {
+ "curl", "-s", "-L", "-f", "-I",
+ "-H", "user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
+ "-H", "Accept-Language: en-US,en;q=0.5",
+ "--",
+ url,
+ NULL
+ };
+ return program_exec(args, NULL, NULL);
+}