Skip to content

avoid Content-Type header when posting an empty body - #5158

Open
BertKoor wants to merge 2 commits into
fisharebest:mainfrom
BertKoor:issue5157_httpPost_ContentType
Open

avoid Content-Type header when posting an empty body#5158
BertKoor wants to merge 2 commits into
fisharebest:mainfrom
BertKoor:issue5157_httpPost_ContentType

Conversation

@BertKoor

@BertKoor BertKoor commented May 26, 2025

Copy link
Copy Markdown
Contributor

fix #5157

This is done to circumvent CRS rule 920420 of Apache ModSecurity.

… an empty body

This is done to circumvent CRS rule 920420 of Apache ModSecurity.
@codecov

codecov Bot commented May 26, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.39%. Comparing base (e7a9d13) to head (f4c0455).
⚠️ Report is 430 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5158      +/-   ##
============================================
- Coverage     35.53%   35.39%   -0.14%     
- Complexity    11143    11182      +39     
============================================
  Files          1157     1165       +8     
  Lines         47737    47998     +261     
============================================
+ Hits          16961    16990      +29     
- Misses        30776    31008     +232     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BertKoor
BertKoor force-pushed the issue5157_httpPost_ContentType branch from 1dc894e to 4d5c73e Compare May 26, 2025 08:29
@BertKoor BertKoor changed the title fix #5157: explicitly set Content-Type header when posting an empty body explicitly set Content-Type header when posting an empty body Jan 23, 2026
@BertKoor BertKoor changed the title explicitly set Content-Type header when posting an empty body avoid Content-Type header when posting an empty body Feb 25, 2026
@BertKoor

Copy link
Copy Markdown
Contributor Author

Oh bugger, apparently I had been looking at the response headers instead of request headers.
As Greg predicted, with null as the default value for the body param the Content-Type header indeed is absent in POST requests.
Fingers crossed that mod_security finds this acceptable as well.

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.

Sign Out Button URI Blocked By Standard Mod Security Install

1 participant