actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

Return 415 rather than 400 on Urlencoded Content-Type mismatch

Open mpalmer opened this issue 1 year ago • 0 comments

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.

mpalmer avatar Apr 15 '24 02:04 mpalmer