-
Notifications
You must be signed in to change notification settings - Fork 254
Open
Description
http_client.c http_client_onread_header函数里面对重定向进行了判断
'''
if(300 <= code && code < 400)
{
if(http_client_redirect_handler(http))
{
code = http_client_request(http, http->parameters.method, http->parameters.uri, http->parameters.headers, http->parameters.n, http->parameters.msg, http->parameters.bytes, http->onreply, http->cbparam);
if(0 != code)
http_client_handle(http, code > 0 ? -code : code);
return;
}
}
'''
但是这里并没有使用Location指定的url,http_client_redirect_handler函数里面仅仅是把Location指定的url保存到http->redirect.urls,应该进行如下修改
'''
http->redirect.urls[http->redirect.n++] = strdup(uri);
//指向Location指定的url
http->parameters.uri=http->redirect.urls[http->redirect.n-1];
'''
ireader and samdestep
Metadata
Metadata
Assignees
Labels
No labels