Commit 855af60
committed
gh-130110: Support hyphens in RFC 2231 continuation parameter names
Parameter names containing hyphens (e.g. `file-name*0*`) were not
recognized as RFC 2231 continuations because the matching regular
expression only allowed `\w+`. As a result, such parameters were left
undecoded by `email.utils.decode_params`.
Adjust the regular expression to also accept hyphens (`[\w-]+`), which
matches the production behaviour for non-hyphenated names.
Fixes: gh-1301101 parent c22e9c9 commit 855af60
2 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
403 | 415 | | |
404 | 416 | | |
405 | 417 | | |
| |||
0 commit comments