豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Fix issue with opting out of headers when using header_hash method#193

Merged
oreoshake merged 1 commit intomasterfrom
calling-name-on-nil-value
Dec 3, 2015
Merged

Fix issue with opting out of headers when using header_hash method#193
oreoshake merged 1 commit intomasterfrom
calling-name-on-nil-value

Conversation

@oreoshake
Copy link
Copy Markdown
Contributor

The header_hash opt-out code was not consistent with the non-header-hash code. Mainly opting out of a header meant you would get an exception:

     NoMethodError:
       undefined method `name' for nil:NilClass
     # ./lib/secure_headers.rb:63:in `block in header_hash'
     # ./lib/secure_headers.rb:54:in `each'
     # ./lib/secure_headers.rb:54:in `inject'
     # ./lib/secure_headers.rb:54:in `header_hash'

I'm going to see if this issue exists on the 3.x branch as well.

/cc @moratorius

oreoshake added a commit that referenced this pull request Dec 3, 2015
Fix issue with opting out of headers when using header_hash method
@oreoshake oreoshake merged commit 6c02a63 into master Dec 3, 2015
@oreoshake oreoshake deleted the calling-name-on-nil-value branch December 3, 2015 23:27
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.

1 participant