Fix regressions introduced in 1c2e562dd6
This commit is contained in:
@@ -332,7 +332,7 @@ bool init_qr(void)
|
|||||||
draw_install(INSTALL_DOWNLOAD);
|
draw_install(INSTALL_DOWNLOAD);
|
||||||
char * zip_buf = NULL;
|
char * zip_buf = NULL;
|
||||||
char * filename = NULL;
|
char * filename = NULL;
|
||||||
u32 zip_size = http_get((char*)scan_data->payload, &filename, &zip_buf, INSTALL_DOWNLOAD);
|
u32 zip_size = http_get((char*)scan_data->payload, &filename, &zip_buf, INSTALL_DOWNLOAD, "application/zip");
|
||||||
|
|
||||||
if(zip_size != 0)
|
if(zip_size != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -892,6 +892,7 @@ redirect: // goto here if we need to redirect
|
|||||||
ParseResult parse = parse_header(&_header, &context, (bool)filename, acceptable_mime_types);
|
ParseResult parse = parse_header(&_header, &context, (bool)filename, acceptable_mime_types);
|
||||||
switch (parse)
|
switch (parse)
|
||||||
{
|
{
|
||||||
|
char err_buf[0x69];
|
||||||
case NO_FILENAME:
|
case NO_FILENAME:
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
break;
|
break;
|
||||||
@@ -926,11 +927,10 @@ redirect: // goto here if we need to redirect
|
|||||||
quit = true;
|
quit = true;
|
||||||
return httpcCloseContext(&context);
|
return httpcCloseContext(&context);
|
||||||
case HTTP_NOT_FOUND:
|
case HTTP_NOT_FOUND:
|
||||||
case HTTP_GONE:
|
case HTTP_GONE: ;
|
||||||
// TODO: check if we're looking at a TP URL, if we are, suggest that it might be missing
|
// TODO: check if we're looking at a TP URL, if we are, suggest that it might be missing
|
||||||
const char * http_error = parse == HTTP_NOT_FOUND ? "404 Not Found" : "410 Gone";
|
const char * http_error = parse == HTTP_NOT_FOUND ? "404 Not Found" : "410 Gone";
|
||||||
DEBUG("HTTP %s; URL: %s\n", http_error, url);
|
DEBUG("HTTP %s; URL: %s\n", http_error, url);
|
||||||
char err_buf[0x69];
|
|
||||||
snprintf(err_buf, 0x69, "HTTP %s\nCheck that the URL is correct.", http_error);
|
snprintf(err_buf, 0x69, "HTTP %s\nCheck that the URL is correct.", http_error);
|
||||||
throw_error(err_buf, ERROR_LEVEL_WARNING);
|
throw_error(err_buf, ERROR_LEVEL_WARNING);
|
||||||
return httpcCloseContext(&context);
|
return httpcCloseContext(&context);
|
||||||
@@ -938,7 +938,6 @@ redirect: // goto here if we need to redirect
|
|||||||
case HTTP_FORBIDDEN:
|
case HTTP_FORBIDDEN:
|
||||||
case HTTP_PROXY_UNAUTHORIZED:
|
case HTTP_PROXY_UNAUTHORIZED:
|
||||||
DEBUG("HTTP %u: device not authenticated\n", parse);
|
DEBUG("HTTP %u: device not authenticated\n", parse);
|
||||||
char err_buf[0x69];
|
|
||||||
snprintf(err_buf, 0x69, "HTTP %s\nContact the site administrator.", parse == HTTP_UNAUTHORIZED
|
snprintf(err_buf, 0x69, "HTTP %s\nContact the site administrator.", parse == HTTP_UNAUTHORIZED
|
||||||
? "401 Unauthorized"
|
? "401 Unauthorized"
|
||||||
: parse == HTTP_FORBIDDEN
|
: parse == HTTP_FORBIDDEN
|
||||||
@@ -979,14 +978,11 @@ redirect: // goto here if we need to redirect
|
|||||||
throw_error("HTTP 504 Gateway Timeout\nContact the site administrator.", ERROR_LEVEL_WARNING);
|
throw_error("HTTP 504 Gateway Timeout\nContact the site administrator.", ERROR_LEVEL_WARNING);
|
||||||
return httpcCloseContext(&context);
|
return httpcCloseContext(&context);
|
||||||
default:
|
default:
|
||||||
{
|
|
||||||
DEBUG("HTTP %u\n", parse);
|
DEBUG("HTTP %u\n", parse);
|
||||||
char err_buf[0x69];
|
|
||||||
snprintf(err_buf, 0x69, "HTTP %u\nIf you believe this is unexpected, please\ncontact the site administrator.", parse);
|
snprintf(err_buf, 0x69, "HTTP %u\nIf you believe this is unexpected, please\ncontact the site administrator.", parse);
|
||||||
throw_error(err_buf, ERROR_LEVEL_WARNING);
|
throw_error(err_buf, ERROR_LEVEL_WARNING);
|
||||||
return httpcCloseContext(&context);
|
return httpcCloseContext(&context);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (filename)
|
if (filename)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user