mirror of
https://github.com/haiwen/seafile.git
synced 2025-01-07 03:17:13 +08:00
Add Authorization header (#2821)
Co-authored-by: yangheran <heran.yang@seafile.com>
This commit is contained in:
parent
303ef33146
commit
e5421f8152
@ -742,6 +742,9 @@ http_get (CURL *curl, const char *url, const char *token,
|
||||
token_header = g_strdup_printf ("Seafile-Repo-Token: %s", token);
|
||||
headers = curl_slist_append (headers, token_header);
|
||||
g_free (token_header);
|
||||
token_header = g_strdup_printf ("Authorization: Token %s", token);
|
||||
headers = curl_slist_append (headers, token_header);
|
||||
g_free (token_header);
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
|
||||
@ -873,6 +876,9 @@ http_put (CURL *curl, const char *url, const char *token,
|
||||
token_header = g_strdup_printf ("Seafile-Repo-Token: %s", token);
|
||||
headers = curl_slist_append (headers, token_header);
|
||||
g_free (token_header);
|
||||
token_header = g_strdup_printf ("Authorization: Token %s", token);
|
||||
headers = curl_slist_append (headers, token_header);
|
||||
g_free (token_header);
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
|
||||
@ -995,6 +1001,9 @@ http_post (CURL *curl, const char *url, const char *token,
|
||||
token_header = g_strdup_printf ("Seafile-Repo-Token: %s", token);
|
||||
headers = curl_slist_append (headers, token_header);
|
||||
g_free (token_header);
|
||||
token_header = g_strdup_printf ("Authorization: Token %s", token);
|
||||
headers = curl_slist_append (headers, token_header);
|
||||
g_free (token_header);
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
|
||||
|
Loading…
Reference in New Issue
Block a user