Skip to content

fix: Normalize HTTP method case in allowMethodOverride middleware#10262

Merged
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/method-override-case-normalization
Mar 20, 2026
Merged

fix: Normalize HTTP method case in allowMethodOverride middleware#10262
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/method-override-case-normalization

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Mar 20, 2026

Issue

Normalize HTTP method case in allowMethodOverride middleware

@parse-github-assistant
Copy link

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement.

@parseplatformorg
Copy link
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e6e2230-9345-407e-a007-739aeebe758d

📥 Commits

Reviewing files that changed from the base of the PR and between f05aca6 and af88731.

📒 Files selected for processing (2)
  • spec/RateLimit.spec.js
  • src/middlewares.js

📝 Walkthrough

Walkthrough

Modified the allowMethodOverride middleware to normalize overridden HTTP methods to uppercase, preventing bypasses of rate limiting via lowercase method overrides. Added a test case verifying rate limits apply to requests using lowercase _method overrides.

Changes

Cohort / File(s) Summary
Rate limit test coverage
spec/RateLimit.spec.js
Added test case for method-override bypass scenario with lowercase _method:'get' on a POST request to verify rate limiting still applies.
Middleware method normalization
src/middlewares.js
Modified allowMethodOverride to normalize the overridden HTTP method to uppercase via req.body._method.toUpperCase(), ensuring consistent method handling regardless of input case.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is completely empty, missing all required sections from the template including Issue, Approach, Tasks, and test/documentation information. Add a comprehensive description following the template: describe the issue being fixed, explain the approach with details about case normalization, and check off completed tasks like the test added in spec/RateLimit.spec.js.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: normalizing HTTP method case in the allowMethodOverride middleware, which is reflected in both the src/middlewares.js changes and the new test case.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.54%. Comparing base (a692873) to head (af88731).
⚠️ Report is 3 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10262      +/-   ##
==========================================
+ Coverage   84.39%   92.54%   +8.15%     
==========================================
  Files         192      192              
  Lines       16433    16433              
  Branches      226      226              
==========================================
+ Hits        13868    15208    +1340     
+ Misses       2545     1205    -1340     
  Partials       20       20              

☔ 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.

@mtrezza mtrezza merged commit a248e8c into parse-community:alpha Mar 20, 2026
20 of 24 checks passed
parseplatformorg pushed a commit that referenced this pull request Mar 20, 2026
# [9.6.0-alpha.47](9.6.0-alpha.46...9.6.0-alpha.47) (2026-03-20)

### Bug Fixes

* Normalize HTTP method case in `allowMethodOverride` middleware ([#10262](#10262)) ([a248e8c](a248e8c))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 9.6.0-alpha.47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants