stripOrigin.tsx 287 B

12345678910
  1. import parseUrl from 'sentry/utils/url/parseUrl';
  2. /**
  3. * Accept a url like:
  4. * `https://example.com/path/name?query=params#hash` and return
  5. * `/path/name?query=params#hash`
  6. */
  7. export default function stripOrigin(url: string) {
  8. return url.replace(parseUrl(url)?.origin ?? '', '');
  9. }