mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-04-06 03:58:02 +08:00
Set User-Agent for QR code HTTP requests.
This commit is contained in:
parent
13d5b854bc
commit
8c25d82c80
@ -69,7 +69,7 @@ static Result qrinstall_open_src(void* data, u32 index, u32* handle) {
|
||||
httpcContext* context = (httpcContext*) calloc(1, sizeof(httpcContext));
|
||||
if(context != NULL) {
|
||||
if(R_SUCCEEDED(res = httpcOpenContext(context, HTTPC_METHOD_GET, qrInstallData->urls[index], 1))) {
|
||||
if(R_SUCCEEDED(res = httpcSetSSLOpt(context, SSLCOPT_DisableVerify)) && R_SUCCEEDED(res = httpcBeginRequest(context)) && R_SUCCEEDED(res = httpcGetResponseStatusCode(context, &qrInstallData->responseCode, 0))) {
|
||||
if(R_SUCCEEDED(res = httpcSetSSLOpt(context, SSLCOPT_DisableVerify)) && R_SUCCEEDED(res = httpcAddRequestHeaderField(context, "User-Agent", "Mozilla/5.0 (Nintendo 3DS; Mobile; rv:10.0) Gecko/20100101 FBI/%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO)) && R_SUCCEEDED(res = httpcBeginRequest(context)) && R_SUCCEEDED(res = httpcGetResponseStatusCode(context, &qrInstallData->responseCode, 0))) {
|
||||
if(qrInstallData->responseCode == 200) {
|
||||
*handle = (u32) context;
|
||||
} else if(qrInstallData->responseCode == 301 || qrInstallData->responseCode == 302 || qrInstallData->responseCode == 303) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user