mirror of https://github.com/status-im/metro.git
Decode URI in asset server
Summary: Solving this issue https://github.com/facebook/react-native/issues/10364 In development when assets are requested from AssetServer, it tries to find them with URI-friendly filenames. I added a single line to decode these filenames. Tests are passing. Couldn't find any discussion regarding whether this is a good idea. This was causing some members of my team a bit of grief earlier. Closes https://github.com/facebook/react-native/pull/10365 Differential Revision: D4168401 Pulled By: hramos fbshipit-source-id: 9ed3606392d8a6f170998caaf0f9254ba4879b49
This commit is contained in:
parent
d79372a56f
commit
475a0c20f6
|
@ -62,6 +62,14 @@ describe('getAssetDataFromName', () => {
|
||||||
name: 'c',
|
name: 'c',
|
||||||
platform: 'ios',
|
platform: 'ios',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
expect(getAssetDataFromName('a/b /c.png')).toEqual({
|
||||||
|
resolution: 1,
|
||||||
|
assetName: 'a/b /c.png',
|
||||||
|
type: 'png',
|
||||||
|
name: 'c',
|
||||||
|
platform: null,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('resolution extraction', () => {
|
describe('resolution extraction', () => {
|
||||||
|
|
|
@ -42,6 +42,7 @@ function getAssetDataFromName(filename, platforms) {
|
||||||
} else {
|
} else {
|
||||||
assetName = filename;
|
assetName = filename;
|
||||||
}
|
}
|
||||||
|
assetName = decodeURIComponent(assetName);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
|
|
Loading…
Reference in New Issue