Commit f36d804
committed
get_content_type(), get_content_maintype(), get_content_subtype(): RFC
2045, section 5.2 states that if the Content-Type: header is
syntactically invalid, the default type should be text/plain.
Implement minimal sanity checking of the header -- it must have
exactly one slash in it. This closes SF patch #597593 by Skip, but in
a different way.
Note that these methods used to raise ValueError for invalid ctypes,
but now they won't.1 parent dfea3b3 commit f36d804
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
426 | 430 | | |
427 | 431 | | |
428 | 432 | | |
| |||
432 | 436 | | |
433 | 437 | | |
434 | 438 | | |
435 | | - | |
436 | | - | |
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
| |||
444 | 446 | | |
445 | 447 | | |
446 | 448 | | |
447 | | - | |
448 | | - | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| |||
0 commit comments