source: trip-planner-front/node_modules/karma/lib/middleware/strip_host.js@ 59329aa

Last change on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 280 bytes
Line 
1/**
2 * Strip hostname from request path
3 * This to handle requests that uses (normally over proxies) an absoluteURI as request path
4 */
5
6function stripHostFromUrl (url) {
7 return url.replace(/^https?:\/\/[a-z.:\d-]+\//, '/')
8}
9
10// PUBLIC API
11exports.stripHost = stripHostFromUrl
Note: See TracBrowser for help on using the repository browser.