Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve normalisation of percent-encoded request URLs
Summary: When processing requests, Metro compares path prefixes and "extensions" to specific magic strings, eg `/[metro-project]/`. Currently, this matching is performed on the literal requested path, which makes it sensitive to URL (percent) encoding. In particular, iOS (`NSURL urlWithString`) encodes some characters more aggressively than other clients, including encoding `[` and `]`. This causes a request for `/[metro-project]/foo.js` to fail with a 404 when executed through `NSURLRequest`, because `urlObj.pathname` begins `/%5Bmetro-project%5D/`. Metro should ideally be insensitive to percent-encoding on all requests. This fix isn't complete, but addresses the particular blocking issue with source URLs. ``` - **[Fix]**: Improve dev server insensitivity to percent encoding on source requests. ``` Reviewed By: motiz88 Differential Revision: D58289369 fbshipit-source-id: 616da5d5e44539996c16f103254f1b5aaa83704c
- Loading branch information