Skip to content

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

Open
BertKoor wants to merge 2 commits intofisharebest:mainfrom
BertKoor:issue5157_httpPost_ContentType
Open

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

Conversation

@BertKoor
Copy link
Copy Markdown
Contributor

@BertKoor BertKoor commented May 26, 2025

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
Copy link
Copy Markdown

codecov Bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.43%. Comparing base (e7a9d13) to head (4d5c73e).
Report is 28 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5158      +/-   ##
============================================
- Coverage     35.53%   35.43%   -0.10%     
- Complexity    11143    11169      +26     
============================================
  Files          1157     1158       +1     
  Lines         47737    47886     +149     
============================================
+ Hits          16961    16967       +6     
- Misses        30776    30919     +143     

☔ View full report in Codecov by Sentry.
📢 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