summaryrefslogtreecommitdiff
path: root/libsoup
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2018-01-03 08:55:53 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2018-01-09 11:50:38 +0100
commit17a682e3d9fb76da46c2feb36b246ef30e4ff167 (patch)
tree424256d51aa72d5469d04433fdf1fbef0069911f /libsoup
parent3dae7b73b082a39a478d687747903369cef74350 (diff)
downloadlibsoup-17a682e3d9fb76da46c2feb36b246ef30e4ff167.tar.gz
soup-headers: accept any 3 digit number as message status code
The HTTP RFC says that status code is extensible, but the category must be known by the client. However, popular websites like linkedin use invalid status codes such as 999, and all the major browsers handle that correctly. There are also WPT tests checking status codes greater than 599 in XMLHTTPRequests. So, let's parse the status code, only failing if it's not a 3 digit number and letting the user handle any other particular case. https://bugzilla.gnome.org/show_bug.cgi?id=792124
Diffstat (limited to 'libsoup')
-rw-r--r--libsoup/soup-headers.c2
-rw-r--r--libsoup/soup-message.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libsoup/soup-headers.c b/libsoup/soup-headers.c
index 1c8900ec..271d2a63 100644
--- a/libsoup/soup-headers.c
+++ b/libsoup/soup-headers.c
@@ -323,7 +323,7 @@ soup_headers_parse_status_line (const char *status_line,
if (code_end != code_start + 3)
return FALSE;
code = atoi (code_start);
- if (code < 100 || code > 599)
+ if (code < 100 || code > 999)
return FALSE;
if (status_code)
*status_code = code;
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index 6287ac14..e4d78476 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -766,7 +766,7 @@ soup_message_class_init (SoupMessageClass *message_class)
g_param_spec_uint (SOUP_MESSAGE_STATUS_CODE,
"Status code",
"The HTTP response status code",
- 0, 599, 0,
+ 0, 999, 0,
G_PARAM_READWRITE));
/**
* SOUP_MESSAGE_REASON_PHRASE: