Resolved merge conflict

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
This commit is contained in:
Uthman Yahaya Baba 2025-05-23 23:33:20 +01:00
parent d3c02b1b99
commit d64aa287aa
2 changed files with 7 additions and 4 deletions

View file

@ -47,7 +47,6 @@ use crate::protocols::{ProtocolRegistry, is_url_potentially_trustworthy};
use crate::request_interceptor::RequestInterceptor;
use crate::subresource_integrity::is_response_integrity_valid;
#[allow(dead_code)]
const PARTIAL_RESPONSE_TO_NON_RANGE_REQUEST_ERROR: &str = "Refusing to provide partial response\
from earlier ranged request to API that did not make a range request";
@ -576,7 +575,9 @@ pub async fn main_fetch(
!request.headers.contains_key(RANGE)
{
// Defer rebinding result
blocked_error_response = Response::network_error(NetworkError::CacheError);
blocked_error_response = Response::network_error(NetworkError::Internal(
PARTIAL_RESPONSE_TO_NON_RANGE_REQUEST_ERROR.to_string(),
));
&blocked_error_response
} else {
internal_response

View file

@ -942,6 +942,7 @@ pub enum NetworkError {
CorsHeaders,
ConnectionFailure,
RedirectError,
TooManyRedirects,
InvalidMethod,
ResourceError,
ContentSecurityPolicy,
@ -968,7 +969,8 @@ impl fmt::Debug for NetworkError {
NetworkError::CorsAuthorization => write!(f, "CORS authorization check failed"),
NetworkError::CorsHeaders => write!(f, "CORS headers check failed"),
NetworkError::ConnectionFailure => write!(f, "Request failed"),
NetworkError::RedirectError => write!(f, "Too many redirects"),
NetworkError::RedirectError => write!(f, "Redirect failed"),
NetworkError::TooManyRedirects => write!(f, "Too many redirects"),
NetworkError::InvalidMethod => write!(f, "Unexpected method"),
NetworkError::ResourceError => write!(f, "Resource access failed"),
NetworkError::ContentSecurityPolicy => write!(f, "Blocked by Content-Security-Policy"),
@ -978,7 +980,7 @@ impl fmt::Debug for NetworkError {
write!(f, "Subresource integrity validation failed")
},
NetworkError::MixedContent => write!(f, "Blocked as mixed content"),
NetworkError::CacheError => write!(f, "Cache error"),
NetworkError::CacheError => write!(f, "Couldn't find response in cache"),
NetworkError::InvalidPort => write!(f, "Request attempted on bad port"),
NetworkError::LocalDirectoryError => write!(f, "Local directory access failed"),
NetworkError::LoadCancelled => write!(f, "Load cancelled"),