Search Issue Tracker
By Design
Votes
0
Found in
2022.3.30f1
6000.0.2f1
Issue ID
UUM-72470
Regression
Yes
[iOS 17] "Malformed URL" error is thrown when using UnityWebRequest with a URI containing "[]"
How to reproduce:
1. Open the attached Project "TestURL.zip"
2. Build and Run the Scene "SampleScene" on an iOS 17 device
3. Observe the Xcode Console
Expected result: "Form upload complete!" is printed
Actual result: "Malformed URL" is printed
Reproducible with: 2022.3.26f1, 2022.3.30f1, 6000.0.2f1
Not reproducible with: 2021.3.38f1, 2022.3.25f1
Reproduced on:
- iPad 6th Gen (iOS 17.2)
Did not reproduce on:
- iPhone 13 Pro (iOS 16.6.1)
Comments (3)
-
Diana_134
Aug 19, 2024 10:15
i have this problem in my adressables. Maybe someone will find my solution useful
static class AddressablesFixUrl
{
//Register to override WebRequests Addressables creates to download
[RuntimeInitializeOnLoadMethod]
private static void Init()
{
Addressables.WebRequestOverride = EditWebRequestURL;
}//Override the url of the WebRequest, the request passed to the method is what would be used as standard by Addressables.
private static void EditWebRequestURL(UnityWebRequest request)
{
if (request.url.Contains('[') || request.url.Contains(']'))
{
string newUrl = request.url.Replace("[", "%5b").Replace("]", "%5d");
request.url = newUrl;
}
}
} -
yapetrichka
Aug 16, 2024 16:33
source url:
familytown.playflock.com/familytown-ios/initV3?initLibrary=server_dev&viewer_id=66bf51b597a2bd5b864e4ca4&libraryList=["ios_21_21"]&authvars={"locale":"en"}encoded url:
familytown.playflock.com%2Ffamilytown-ios%2FinitV3%3FinitLibrary%3Dserver_dev%26viewer_id%3D66bf51b597a2bd5b864e4ca4%26libraryList%3D%5B%22ios_21_21%22%5D%26authvars%3D%7B%22locale%22%3A%22en%22%7D -
yapetrichka
Aug 16, 2024 16:32
We try encode result string for UnityWebRequest on iOS 17 and get error:
-1004 NSURLErrorDomain
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture is not applied on a Custom Render Texture when a Cubemap is selected as the texture
- 2D light leaks through ShadowCaster2D when ShadowCaster2D components are disabled then re enabled at runtime in Player builds
- Unity Hub redirects to The Unity Roadmap when navigating to “Send Feedback” option
- UI Toolkit throws warning and fails to clear references when fields are not typed as UnityEngine.Object
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
Resolution Note:
The recommendation is to always use properly escaped URLs, especially if they are hardcoded. The characters [ and ] need to be escaped as %5b and %5d
When URL that hasn't been properly escaped is used, the automatic escaping system is used that in some cases is not capable of escaping as URI syntax is ambiguous and by having only URI it's not even possible to know what the result should be. We don't want to introduce regressions by adding more escaping cases, hence we don't intend to fix this for Unity 6 and older.