This repository was archived by the owner on Jul 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 200200 if ( wildcard )
201201 outPath = outPath . replace ( '*' , wildcard ) ;
202202
203- // percent encode each path part
204- if ( isBrowser ) {
205- var outParts = outPath . split ( '/' ) ;
206- for ( var i = 0 , l = outParts . length ; i < l ; i ++ ) {
207- outParts [ i ] = encodeURIComponent ( outParts [ i ] ) ;
208- }
209- outPath = outParts . join ( '/' ) ;
210- }
203+ // percent encode just '#' in module names
204+ // according to https://github.com/jorendorff/js-loaders/blob/master/browser-loader.js#L238
205+ // we should encode everything, but it breaks for servers that don't expect it
206+ // like in (https://github.com/systemjs/systemjs/issues/168)
207+ if ( isBrowser )
208+ outPath = outPath . replace ( / # / g, '%40' ) ;
211209
212210 return toAbsoluteURL ( this . baseURL , outPath ) ;
213211 } ,
Original file line number Diff line number Diff line change @@ -144,10 +144,7 @@ function runTests() {
144144
145145 System . baseURL = 'http://example.org/a/' ;
146146
147- if ( typeof window != 'undefined' )
148- test ( 'Locate' , System . locate ( { name : '@abc/def' } ) , 'http://example.org/a/%40abc/def.js' ) ;
149- else
150- test ( 'Locate' , System . locate ( { name : '@abc/def' } ) , 'http://example.org/a/@abc/def.js' ) ;
147+ test ( 'Locate' , System . locate ( { name : '@abc/def' } ) , 'http://example.org/a/@abc/def.js' ) ;
151148 test ( 'Locate' , System . locate ( { name : 'abc/def' } ) , 'http://example.org/a/abc/def.js' ) ;
152149
153150 // paths
You can’t perform that action at this time.
0 commit comments