[APM] Fix problems with tilde in transaction name (#33309) (#33365)

# Conflicts:
#	x-pack/plugins/apm/public/components/shared/Links/url_helpers.test.tsx
#	x-pack/plugins/apm/public/components/shared/Links/url_helpers.ts
This commit is contained in:
Søren Louv-Jansen 2019-03-18 11:57:04 +01:00 committed by GitHub
parent 67e218022f
commit ee75231ec6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,7 +227,12 @@ export const KibanaLink = withLocation(UnconnectedKibanaLink);
// Angular decodes encoded url tokens like "%2F" to "/" which causes the route to change.
// It was supposedly fixed in https://github.com/angular/angular.js/commit/1b779028fdd339febaa1fff5f3bd4cfcda46cc09 but still seeing the issue
export function legacyEncodeURIComponent(rawUrl?: string) {
return rawUrl && encodeURIComponent(rawUrl).replace(/%/g, '~');
return (
rawUrl &&
encodeURIComponent(rawUrl)
.replace(/~/g, '%7E')
.replace(/%/g, '~')
);
}
export function legacyDecodeURIComponent(encodedUrl?: string) {