mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +00:00
LibRequests+RequestServer: Add an error code for bad content encoding
This error is set by curl when, e.g., a gzipped response body has an invalid gzip encoding.
This commit is contained in:
parent
e0c4801e0f
commit
b54a520b69
Notes:
github-actions[bot]
2025-04-20 14:51:44 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b54a520b69e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4405 Reviewed-by: https://github.com/alimpfard ✅
2 changed files with 6 additions and 1 deletions
|
@ -19,7 +19,8 @@ enum class NetworkError {
|
|||
SSLHandshakeFailed,
|
||||
SSLVerificationFailed,
|
||||
MalformedUrl,
|
||||
Unknown
|
||||
InvalidContentEncoding,
|
||||
Unknown,
|
||||
};
|
||||
|
||||
constexpr StringView network_error_to_string(NetworkError network_error)
|
||||
|
@ -41,6 +42,8 @@ constexpr StringView network_error_to_string(NetworkError network_error)
|
|||
return "SSL verification failed"sv;
|
||||
case NetworkError::MalformedUrl:
|
||||
return "The URL is not formatted properly"sv;
|
||||
case NetworkError::InvalidContentEncoding:
|
||||
return "Response could not be decoded with its Content-Encoding"sv;
|
||||
case NetworkError::Unknown:
|
||||
return "An unexpected network error occurred"sv;
|
||||
}
|
||||
|
|
|
@ -527,6 +527,8 @@ static Requests::NetworkError map_curl_code_to_network_error(CURLcode const& cod
|
|||
return Requests::NetworkError::SSLVerificationFailed;
|
||||
case CURLE_URL_MALFORMAT:
|
||||
return Requests::NetworkError::MalformedUrl;
|
||||
case CURLE_BAD_CONTENT_ENCODING:
|
||||
return Requests::NetworkError::InvalidContentEncoding;
|
||||
default:
|
||||
return Requests::NetworkError::Unknown;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue