This repository was archived by the owner on Jul 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 200
200
if ( wildcard )
201
201
outPath = outPath . replace ( '*' , wildcard ) ;
202
202
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' ) ;
211
209
212
210
return toAbsoluteURL ( this . baseURL , outPath ) ;
213
211
} ,
Original file line number Diff line number Diff line change @@ -144,10 +144,7 @@ function runTests() {
144
144
145
145
System . baseURL = 'http://example.org/a/' ;
146
146
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' ) ;
151
148
test ( 'Locate' , System . locate ( { name : 'abc/def' } ) , 'http://example.org/a/abc/def.js' ) ;
152
149
153
150
// paths
You can’t perform that action at this time.
0 commit comments