Skip to content

Conversation

pgjones
Copy link
Member

@pgjones pgjones commented Jul 1, 2022

I cannot find a RFC that indicates that the option names are case
sensitive whereas RFC6266 states that the filename option name is
case insensitive. Therefore the best user experience is to lowercase
the names.

This will cause breaking changes if case sensitivity is relied upon,
and hence users will need to use the lowercase name if so.

closes #2422

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@pgjones
Copy link
Member Author

pgjones commented Jul 1, 2022

I need to finish this - before then I want to check we are happy with an addition datastructure

@davidism
Copy link
Member

davidism commented Jul 1, 2022

Referencing ASGI django/asgiref#246 (comment), incoming headers (and options) should be lowercased. I don't think it's worth adding a whole new datastructure (and it's missing at least get and setdefault) versus just lowercasing when parsing.

@pgjones pgjones changed the title Utilise a CaseInsensitiveDict for the parsed options Lowercase the parsed options names Jul 1, 2022
I cannot find a RFC that indicates that the option names are case
sensitive whereas RFC6266 states that the `filename` option name is
case insensitive. Therefore the best user experience is to lowercase
the names.

This will cause breaking changes if case sensitivity is relied upon,
and hence users will need to use the lowercase name if so.
@davidism davidism added this to the 2.2.0 milestone Jul 4, 2022
@davidism davidism merged commit f488ea1 into pallets:main Jul 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2022
@pgjones pgjones deleted the options branch February 12, 2023 21:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multipart disposition parameter parser is case-sensitive in violation of RFC6266
2 participants