NET-Web-API-w-Angular/my-app/node_modules/karma/lib/middleware/strip_host.js

12 lines
280 B
JavaScript
Raw Normal View History

2024-02-09 00:38:41 +00:00
/**
* Strip hostname from request path
* This to handle requests that uses (normally over proxies) an absoluteURI as request path
*/
function stripHostFromUrl (url) {
return url.replace(/^https?:\/\/[a-z.:\d-]+\//, '/')
}
// PUBLIC API
exports.stripHost = stripHostFromUrl