diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index 6fa6bc3d9e..b90b898805 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -3771,7 +3771,9 @@ shaka.hls.HlsParser = class { contentMimeType = response.headers['content-type']; } catch (error) { - if (error && error.code == shaka.util.Error.Code.HTTP_ERROR) { + if (error && + (error.code == shaka.util.Error.Code.HTTP_ERROR || + error.code == shaka.util.Error.Code.BAD_HTTP_STATUS)) { headRequest.method = 'GET'; const response = await this.makeNetworkRequest_( headRequest, requestType, {type}); diff --git a/lib/net/networking_utils.js b/lib/net/networking_utils.js index f76b2ad630..c0648ff656 100644 --- a/lib/net/networking_utils.js +++ b/lib/net/networking_utils.js @@ -37,7 +37,9 @@ shaka.net.NetworkingUtils = class { const response = await netEngine.request(type, request).promise; mimeType = response.headers['content-type']; } catch (error) { - if (error && error.code == shaka.util.Error.Code.HTTP_ERROR) { + if (error && + (error.code == shaka.util.Error.Code.HTTP_ERROR || + error.code == shaka.util.Error.Code.BAD_HTTP_STATUS)) { request.method = 'GET'; const response = await netEngine.request(type, request).promise; mimeType = response.headers['content-type'];