Skip to content
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

fix urlEncodedStringWithEncoding to remove reserved characters #165

Closed
wants to merge 1 commit into from

Conversation

tkawaji
Copy link
Contributor

@tkawaji tkawaji commented Dec 26, 2015

There is signiture error when parameter value includes line feed code(\n).
So I basically use NSCharacterSet.URLQueryAllowedCharacterSet for stringByAddingPercentEncodingWithAllowedCharacters.
And remove some characters defined as reserved in RFC 3986.

I think there are big changes in urlencoding behavior from existing source code.
So I would appreciate if you could check carefully.

Thank you.

@phimage
Copy link
Member

phimage commented Dec 26, 2015

yes it's a thing to look carefully

there is some code here also #115

And after studying the case of space character here #156, I read in RFC that there is two things
Encoding for signature and for further url request

Did you try to launch unit test using the workspace and pod command to retrieve dependencies?
there is a signatureTest for only one case

@tkawaji
Copy link
Contributor Author

tkawaji commented Dec 26, 2015

I couldn't setup unit test environment.
Is there any document about how to launch unit test?

@phimage
Copy link
Member

phimage commented Dec 26, 2015

No sorry, I must do it one day

Cocoapod must be installed

sudo gem install cocoapods

(close any xcode OAuthSwift project if opened)
in OAuthSwift directory

 pod install

open OAuthSwift.xcworkspace (not OAuthSwift.xcodeproj)

To launch test, choose scheme OAuthSwiftTests and do Menu:Product then Test (Command U)

@phimage
Copy link
Member

phimage commented Dec 26, 2015

Just tested testSignature and it's ok

@tkawaji
Copy link
Contributor Author

tkawaji commented Dec 26, 2015

Thank you.

I setup test environment, but I have some error:
"HttpResponseBody has no member STRING"

I think that version of Swifter is different.
need Podfile.lock?

@phimage
Copy link
Member

phimage commented Dec 26, 2015

Swifter was 1.0.2 instead of 1.0.6 in my repository
I fix that, thanks : b819075

@tkawaji
Copy link
Contributor Author

tkawaji commented Dec 26, 2015

Thank you. I could run test case.
And testSignature is OK, too.

@phimage
Copy link
Member

phimage commented Mar 9, 2016

PR #201 merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants