From e29801fd35ac050284e90854cde751eec665ec50 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 2 Jan 2024 15:43:40 -0500 Subject: [PATCH] com.utilities.rest 2.4.6 (#62) - fix request parameters url escape --- Runtime/BaseEndPoint.cs | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Runtime/BaseEndPoint.cs b/Runtime/BaseEndPoint.cs index 761992d..3620450 100644 --- a/Runtime/BaseEndPoint.cs +++ b/Runtime/BaseEndPoint.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; +using UnityEngine.Networking; using Utilities.WebRequestRest.Interfaces; namespace Utilities.WebRequestRest @@ -44,7 +45,7 @@ protected string GetUrl(string endpoint = "", Dictionary queryPa if (queryParameters is { Count: not 0 }) { - result += $"?{string.Join("&", queryParameters.Select(parameter => $"{parameter.Key}={parameter.Value}"))}"; + result += $"?{string.Join("&", queryParameters.Select(parameter => $"{UnityWebRequest.EscapeURL(parameter.Key)}={UnityWebRequest.EscapeURL(parameter.Value)}"))}"; } return result; diff --git a/package.json b/package.json index 89b9c3a..6a9847a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Utilities.Rest", "description": "This package contains useful RESTful utilities for the Unity Game Engine.", "keywords": [], - "version": "2.4.5", + "version": "2.4.6", "unity": "2021.3", "documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest#documentation", "changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest/releases",