mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-26 08:59:26 -05:00
74dc6e8b5e
* only send auth headers to the original protection space * cleanup * test now fails w/o fix * note about moving this into lib/util/uri.js * refactor, cleanup, and provide more context * add lots of tests around cors.urlMatchesOriginProtectionSpace - fix some edge cases and yes… bugs due to behavior of url.format(…) - if host is set, port value is ignored, so we must clear it out - protocol contains a ‘:’ character, fixed the protocol + port constants - synchronize method signatures to always return a safely cloned url.parse(…) object - add url notes * have buffers use url utility * fixes failing tests * remove unused require Co-authored-by: Brian Mann <brian.mann86@gmail.com>
15 lines
284 B
JavaScript
15 lines
284 B
JavaScript
// TODO: move this into lib/util/uri.js
|
|
const url = require('url')
|
|
|
|
module.exports = function (urlStr) {
|
|
const parsed = url.parse(urlStr)
|
|
|
|
parsed.hash = null
|
|
parsed.search = null
|
|
parsed.query = null
|
|
parsed.path = null
|
|
parsed.pathname = null
|
|
|
|
return url.format(parsed)
|
|
}
|