SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Reapply Fix escaping in the URL conversion (#36949)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36949

This change is a second attempt at fixing URL encoding and escaping that was already tried [here](https://github.com/facebook/react-native/commit/2b4e1f5ece7d160935b19d4862af8706a44cee59).

We had to roll it back due to some internal tests failing as it looks like Jest is manipulating the URL somehow.

We manage to replicate the issue, which occur when we pre-decode a url even if it is not partially encoded (we were too aggrsssive).

This fix ensure that we pre-decode the urls only if they present some `%` characters.

The problem here was that the e2e tests sends some urls with some `%` symbol which does not belongs to an escape sequence. For example: `anna://launch?height=25%`.

The previous code (v1) was trying to unescape this case. V2 fixes this.

This change should also fix #28508 for good.

## Changelog:
[iOS][Fixed] - Properly escape URLs

Reviewed By: mdvacca

Differential Revision: D45078923

fbshipit-source-id: 010a5c173784f8341a1a08bcbd06a6ad14299c75
R
Riccardo Cipolleschi committed
5e983d51d8bc2abded5659a77808542c6dc1377a
Parent: c65ab4d
Committed by Facebook GitHub Bot <[email protected]> on 4/25/2023, 11:43:21 AM