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

#authenticate_with_http_token raises an exception from 6.1.1 If token.blank? #41279

Closed
kentakag opened this issue Jan 30, 2021 · 1 comment · Fixed by #41280
Closed

#authenticate_with_http_token raises an exception from 6.1.1 If token.blank? #41279

kentakag opened this issue Jan 30, 2021 · 1 comment · Fixed by #41280

Comments

@kentakag
Copy link
Contributor

Steps to reproduce

  1. Send http request with authorization header type, but without credentials
token = nil # or token = ''
request.headers['Authorization'] = "Bearer #{token}"
request.get
  1. Use authenticate_with_http_token to check the token.
authenticate_with_http_token do |token, _options|
  # 
end

Expected behavior

return nil.
Under 6.1.1, it did.

Actual behavior

NoMethodError:
       undefined method `start_with?' for nil:NilClass

The cause is probably this commit

System configuration

Rails version:
6.1.1
Ruby version:
2.7.2p137

@kentakag
Copy link
Contributor Author

I've created a pull request.
#41280

@kamipo kamipo linked a pull request Feb 1, 2021 that will close this issue
kamipo added a commit that referenced this issue Feb 1, 2021
…raise-an-exception

Fix raw params method to not raise an exception

Fixes #41279.
kamipo added a commit that referenced this issue Feb 1, 2021
…raise-an-exception

Fix raw params method to not raise an exception

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

Successfully merging a pull request may close this issue.

2 participants