actix-web
actix-web copied to clipboard
Return 415 rather than 400 on Urlencoded Content-Type mismatch
PR Type
Bug Fix
PR Checklist
- [x] Tests for the changes have been added / updated.
- [N/A] Documentation comments have been added / updated.
- [x] A changelog entry has been made for the appropriate packages.
- [x] Format code with the latest stable rustfmt.
- [ ] (Team) Label with affected crates and semver status.
Overview
When the Content-Type of a request that was parsed by UrlEncoded wasn't appropriate, a generic 400 response was returned. Given that there is a dedicated response code for this (415), I thought it better to return that instead, so now it does.