File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -474,10 +474,8 @@ export default class ElectronPlatform extends BasePlatform {
474
474
const url = super . getOidcCallbackUrl ( ) ;
475
475
url . protocol = "io.element.desktop" ;
476
476
// Trim the double slash into a single slash to comply with https://datatracker.ietf.org/doc/html/rfc8252#section-7.1
477
- // Chrome seems to have a strange issue where non-standard protocols prevent URL object mutations on pathname
478
- // field, so we cannot mutate `pathname` reliably and instead have to rewrite the href manually.
479
- if ( url . pathname . startsWith ( "//" ) ) {
480
- url . href = url . href . replace ( url . pathname , url . pathname . slice ( 1 ) ) ;
477
+ if ( url . href . startsWith ( `${ url . protocol } ://` ) ) {
478
+ url . href = url . href . replace ( "://" , ":/" ) ;
481
479
}
482
480
return url ;
483
481
}
You can’t perform that action at this time.
0 commit comments