diff --git a/lib/net/http_plugin_utils.js b/lib/net/http_plugin_utils.js index 8ac471671b..ec8043d684 100644 --- a/lib/net/http_plugin_utils.js +++ b/lib/net/http_plugin_utils.js @@ -58,7 +58,8 @@ shaka.net.HttpPluginUtils = class { status, responseText, headers, - requestType); + requestType, + responseURL || uri); } } }; diff --git a/lib/util/error.js b/lib/util/error.js index 16a649be5b..38d369567d 100644 --- a/lib/util/error.js +++ b/lib/util/error.js @@ -212,6 +212,8 @@ shaka.util.Error.Code = { *
error.data[3] is the map of response headers. *
error.data[4] is the NetworkingEngine.RequestType of the request, * if one was provided. + *
error.data[5] is the final URI. This may be different if the initial + * URI (error.data[0]) issued a redirect. */ 'BAD_HTTP_STATUS': 1001, diff --git a/test/net/http_plugin_unit.js b/test/net/http_plugin_unit.js index 20fc7a5036..428612b93a 100644 --- a/test/net/http_plugin_unit.js +++ b/test/net/http_plugin_unit.js @@ -227,7 +227,7 @@ function httpPluginTests(usingFetch) { shaka.util.Error.Severity.RECOVERABLE, shaka.util.Error.Category.NETWORK, shaka.util.Error.Code.BAD_HTTP_STATUS, - uri, 202, '', jasmine.any(Object), requestType); + uri, 202, '', jasmine.any(Object), requestType, uri); await testFails(uri, expected); }); @@ -237,7 +237,7 @@ function httpPluginTests(usingFetch) { shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.NETWORK, shaka.util.Error.Code.BAD_HTTP_STATUS, - uri, 401, '', jasmine.any(Object), requestType); + uri, 401, '', jasmine.any(Object), requestType, uri); await testFails(uri, expected); }); @@ -247,7 +247,7 @@ function httpPluginTests(usingFetch) { shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.NETWORK, shaka.util.Error.Code.BAD_HTTP_STATUS, - uri, 403, '', jasmine.any(Object), requestType); + uri, 403, '', jasmine.any(Object), requestType, uri); await testFails(uri, expected); }); @@ -257,7 +257,7 @@ function httpPluginTests(usingFetch) { shaka.util.Error.Severity.RECOVERABLE, shaka.util.Error.Category.NETWORK, shaka.util.Error.Code.BAD_HTTP_STATUS, - uri, 404, 'ABC', {'foo': 'BAR'}, requestType); + uri, 404, 'ABC', {'foo': 'BAR'}, requestType, uri); await testFails(uri, expected); });