Skip to content

URLs with percent encoded properties in incorrect signature #11

@hauntii

Description

@hauntii

I use OhhAuth.calculateSignature inside an interceptor, and I've come across a bad edge case. If the path of the request needs to be percent encoded (say, for a space) the signature generated will be invalid as it will take the path from the URL directly, causing it to grab the path without the encoding done to it.

An example of a URL this fails on: https://api-http2.tumblr.com/v2/hubs/random%20tag/timeline.

I've fixed this locally on my end by sticking .addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)! to the end of self.path on line 306 in oAuthBaseURL().

Just wanted to bring this to your attention, but didn't create a PR if you've got a better way of doing this that's more to spec or something (I'm very bodgy with my Swift code)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions