http: Check the auth string contents and not only the pointer

This makes sure we don't send the Except: 100-continue header
if no authentication credentials have been provided.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Michael Niedermayer 2013-10-14 00:56:32 +02:00 committed by Martin Storsjö
parent a3fabc6cb3
commit 708b32b6f7

View File

@ -461,7 +461,8 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
* send Expect: 100-continue to get the 401 response including the
* WWW-Authenticate header, or an 100 continue if no auth actually
* is needed. */
if (auth && s->auth_state.auth_type == HTTP_AUTH_NONE &&
if (auth && *auth &&
s->auth_state.auth_type == HTTP_AUTH_NONE &&
s->http_code != 401)
send_expect_100 = 1;
}