Skip to content

Commit

Permalink
Merge pull request #49 from tim-vandecasteele/query_string
Browse files Browse the repository at this point in the history
Support query string separator for all callbacks.
  • Loading branch information
jcoglan committed Apr 4, 2013
2 parents acd5573 + 5283bc3 commit 8fc59ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/songkick/oauth2/provider/authorization.rb
Expand Up @@ -101,7 +101,7 @@ def redirect_uri

else
query = to_query_string(CODE, SCOPE, STATE)
"#{ base_redirect_uri }?#{ query }"
"#{ base_redirect_uri }#{ q }#{ query }"
end
end

Expand Down
11 changes: 11 additions & 0 deletions spec/songkick/oauth2/provider/authorization_spec.rb
Expand Up @@ -132,6 +132,17 @@
end
end

describe "with a redirect_uri with parameters" do
before do
authorization.client.redirect_uri = "http://songkick.com?some_parameter"
params['redirect_uri'] = "http://songkick.com?some_parameter"
end

it "adds the extra parameters with & instead of ?" do
authorization.redirect_uri.should == "http://songkick.com?some_parameter&"
end
end

# http://en.wikipedia.org/wiki/HTTP_response_splitting
# scope and state values are passed back in the redirect

Expand Down

0 comments on commit 8fc59ee

Please sign in to comment.