Skip to content

Add lambda DSL method for featurePolicy #17492

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

therepanic
Copy link
Contributor

Closes: gh-17321

Comment on lines +45 to +50
/**
* Create a new instance of {@link FeaturePolicyHeaderWriter}
*/
public FeaturePolicyHeaderWriter() {
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PermissionsPolicyHeaderWriter has an empty constructor, while FeaturePolicyHeaderWriter does not. To create a method with a customizer, I created an empty constructor for it. Is that okay?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 7, 2025
@DeepDhamala
Copy link
Contributor

I think it's reasonable that you added the constructor. The default constructor was originally absent to ensure that FeaturePolicyHeaderWriter couldn't be instantiated without explicitly providing policyDirectives at the time of instantiation.
Now that we're requiring the Customizer to be passed via the DSL, it makes sense that policyDirectives must be set using .setPolicyDirectives(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add lambda DSL method for featurePolicy
3 participants