Cannot use the `append_content_security_policy_directives` method in `ApplicationController`
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 873
- Forks
- 164
- Avg merge
- 4d 27m
- Merged PRs (30d)
- 9
Description
The append_content_security_policy_directives from SecureHeaders can be referenced in ApplicationController as follows:
class ApplicationController < ActionController::Base
def foo
append_content_security_policy_directives(xxxx)
end
end
However, Sorbet seems unable to find append_content_security_policy_directives.
Method
append_content_security_policy_directivesdoes not exist onApplicationController
By the way, the method is generated in RBI as follows:
# sorbet/rbi/gems/secure_headers@7.1.0.rbi
module SecureHeaders
def append_content_security_policy_directives(additions); end
# ...
end
Therefore, it's possible that ActionController and SecureHeaders are not linked correctly.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the generated sorbet/rbi/gems/secure_headers@7.1.0.rbi and the ApplicationController usage described in the issue. Trace how SecureHeaders is included or extended in ActionController and how Tapioca links those declarations. Done means Sorbet recognizes append_content_security_policy_directives when called from ApplicationController, with coverage for the reported setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100