mirror of
https://github.com/moparisthebest/curl
synced 2024-11-11 20:15:03 -05:00
http: fix the check for 'Authorization' with Bearer
The code would wrongly check for it using an additional colon. Reported-by: Blake Burkhart Closes #6988
This commit is contained in:
parent
3a6058cb97
commit
8b9de77cd2
@ -740,7 +740,7 @@ output_auth_headers(struct Curl_easy *data,
|
||||
if(authstatus->picked == CURLAUTH_BEARER) {
|
||||
/* Bearer */
|
||||
if((!proxy && data->set.str[STRING_BEARER] &&
|
||||
!Curl_checkheaders(data, "Authorization:"))) {
|
||||
!Curl_checkheaders(data, "Authorization"))) {
|
||||
auth = "Bearer";
|
||||
result = http_output_bearer(data);
|
||||
if(result)
|
||||
|
@ -99,6 +99,8 @@ char *Curl_checkheaders(const struct Curl_easy *data,
|
||||
{
|
||||
struct curl_slist *head;
|
||||
size_t thislen = strlen(thisheader);
|
||||
DEBUGASSERT(thislen);
|
||||
DEBUGASSERT(thisheader[thislen-1] != ':');
|
||||
|
||||
for(head = data->set.headers; head; head = head->next) {
|
||||
if(strncasecompare(head->data, thisheader, thislen) &&
|
||||
|
Loading…
Reference in New Issue
Block a user