Closed Belfegor1991 closed 1 year ago
Thanks for the alert+fix.
A little concerning that the docs for HttpUtility.UrlPathEncode say Do not use
...however it seems to work fine and I don't see any downside to implement this.
I hope to roll this fix out in the next couple of days as part of https://github.com/f2calv/CasCap.Apis.GooglePhotos/pull/112
Sometimes when uploading files with names that contain non-English characters fails. For example, uploading of file a "D:\2003.02.06 - (Открытый) Урок английского.jpg" fails and the server returns an HTML page
which eventually results in Newtonsoft.Json.JsonReaderException
The reason for this is the HTTP standard that doesn't support non-ISO-8859-1 characters directly in an HTTP header. Thus characters should be encoded to be passed in the header.
Suggested fix: use HttpUtility.UrlPathEncode in GooglePhotosServiceBase.UploadMediaAsync: