Preserve trailing slash in signature base #5

Merged
merged 2 commits into from Feb 27, 2013

Projects

None yet

2 participants

@nwg
Contributor
nwg commented Feb 22, 2013

This patch changes the library to preserve the trailing slash when computing
the signature base string.

-[NSURL path] function always excludes a trailing slash. Since the oauth specification
makes no mention of excluding a trailing slash, it seems correct to preserve it. At least
one python server-side library will not accept requests without this patch.

@nwg nwg Preserve trailing slash in signature base
This patch changes the library to preserve the trailing slash when computing
the signature base string.

-[NSURL path] function always excludes a trailing slash. Since the oauth specification
makes no mention of excluding a trailing slash, it seems correct to preserve it. At least
one python server-side library will not accept requests without this patch.
60f0c67
@nwg
Contributor
nwg commented Feb 22, 2013

Note that this only preserves a trailing slash if one is provided when generating the passed URL, it will not unconditionally add one.

@nwg nwg Update ab_actualPath to use CFURLCopyPath
This should be a little more reliable
0bf20a9
@nwg
Contributor
nwg commented Feb 22, 2013

Based on the thread and some verification, i am reasonably confident that the behavior of CFURLCopyPath is exactly the same as -[NSURL path], except that it will preserve any trailing slash(es).

@atebits atebits merged commit 08727c2 into atebits:master Feb 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment