-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attach Invoice With Spaces in Filename Causes 404 Error - Xero.NetStandard.OAuth2 9.2.0 #570
Comments
PETOSS-645 |
Thanks for raising an issue, a ticket has been created to track your request |
We have noted that while the documentation states: If we actually URL path encode the filename the filename with spaces can be uploaded again. (This means replacing spaces with %20, not +) |
This just happened to me, I had to use System.Uri.EscapeDataString instead of WebUtility.UrlEncode |
Yes, FYI the answer is to use System.Uri.EscapeDataString that escapes spaces as "%20" System.Net.WebUtility.UrlEncode encodes spaces as '+' which does not work. |
Can the change be listed in releases as a breaking change? This broke production when our users started getting errors after upgrading and there is no mention of this in the changelog. |
+1, this is what RestSharp is using (and therefore what this SDK was using up to 9.x.x). For reference:
This raises the question of whether compatibility with massive URLs should also be preserved as part of the fix? Seems like the sensible option given we can simply adopt RestSharp's method - there's a simplified version in the codebase already. |
SDK you're using (please complete the following information):
Describe the bug
We have upgraded from Xero.NetStandard.OAuth2 6.0.0 to Xero.NetStandard.OAuth2 9.2.0
When uploading files to attach to an invoice we now get an error code 404, with error content "The resource you're looking for cannot be found"
If we remove the spaces from the filename the upload works correctly.
We have noticed that this error was introduced in Xero.NetStandard.OAuth2 9.0.0
The issue does not occur in 8.1.0.
To Reproduce
Upload a file with spaces.
Expected behavior
File attachment with spaces can be uploaded via .NET API.
The text was updated successfully, but these errors were encountered: