Skip to content

feat(referer-restriction): Add configuration to block requests with m…#13126

Open
hachi029 wants to merge 3 commits intoapache:masterfrom
hachi029:block-invalid-referer
Open

feat(referer-restriction): Add configuration to block requests with m…#13126
hachi029 wants to merge 3 commits intoapache:masterfrom
hachi029:block-invalid-referer

Conversation

@hachi029
Copy link
Copy Markdown
Contributor

@hachi029 hachi029 commented Mar 29, 2026

…alformed Referer headers

Description

Add configuration to block requests with malformed Referer headers

Which issue(s) this PR fixes:

Fixes #13110

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Mar 29, 2026
Copy link
Copy Markdown
Contributor

@Baoyuantop Baoyuantop left a comment

Choose a reason for hiding this comment

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

It is recommended to add a test case that covers the combination of bypass_malformed: false + bypass_missing: false + malformed Referer to ensure that the interaction behavior of the two configuration items is tested and guaranteed.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 30, 2026
@hachi029
Copy link
Copy Markdown
Contributor Author

It is recommended to add a test case that covers the combination of bypass_malformed: false + bypass_missing: false + malformed Referer to ensure that the interaction behavior of the two configuration items is tested and guaranteed.

Updated the test cases as per your advice.

@hachi029 hachi029 requested a review from Baoyuantop March 30, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add parameter block-when-referrer-not-parsable to plugin referer-restriction

2 participants