diff --git a/static/static/rest_framework/js/coreapi-0.1.1.js b/static/static/rest_framework/js/coreapi-0.1.1.js index 3c5a2be29..c1de08437 100644 --- a/static/static/rest_framework/js/coreapi-0.1.1.js +++ b/static/static/rest_framework/js/coreapi-0.1.1.js @@ -1310,6 +1310,17 @@ URL.prototype.toString = function toString(stringify) { result += url.username; if (url.password) result += ':'+ url.password; result += '@'; + } else if ( + url.protocol !== 'file:' && + isSpecial(url.protocol) && + !url.host && + url.pathname !== '/' + ) { + // + // Add back the empty userinfo, otherwise the original invalid URL + // might be transformed into a valid one with `url.pathname` as host. + // + result += '@'; } result += url.host + url.pathname;