Commit 2786f83
Change
[RFC 822](https://datatracker.ietf.org/doc/html/rfc822), which specifies the notation used to describe the syntax of a media type in [RFC 2045](https://datatracker.ietf.org/doc/html/rfc2045#section-5.1), seems to [indicate](https://datatracker.ietf.org/doc/html/rfc822#section-3.1.4) that spaces should be allowed here (and in fact if it didn't, nothing in the specification would allow them around the `;` either).
Fixes #6663.
RELNOTES=`net`: Made `MediaType.parse` allow and skip over whitespace around the `/` and `=` separator tokens in addition to the `;` separator for which it was already being allowed.
PiperOrigin-RevId: 554496121MediaType.parse to allow and skip over linear whitespace on either side of the = separator in a parameter (attribute=value) as well as on either side of the / between the type and subtype (because nothing in the specification suggests that it be treated differently than the ; or the =).1 parent c6d35cf commit 2786f83
4 files changed
Lines changed: 54 additions & 16 deletions
File tree
- android
- guava-tests/test/com/google/common/net
- guava/src/com/google/common/net
- guava-tests/test/com/google/common/net
- guava/src/com/google/common/net
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
515 | 523 | | |
516 | 524 | | |
517 | 525 | | |
| |||
556 | 564 | | |
557 | 565 | | |
558 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
559 | 570 | | |
560 | 571 | | |
561 | 572 | | |
| |||
571 | 582 | | |
572 | 583 | | |
573 | 584 | | |
574 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
575 | 590 | | |
576 | 591 | | |
577 | 592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1052 | 1052 | | |
1053 | 1053 | | |
1054 | 1054 | | |
1055 | | - | |
| 1055 | + | |
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
| 1059 | + | |
1062 | 1060 | | |
1063 | | - | |
| 1061 | + | |
1064 | 1062 | | |
1065 | 1063 | | |
1066 | 1064 | | |
| |||
1086 | 1084 | | |
1087 | 1085 | | |
1088 | 1086 | | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1089 | 1093 | | |
1090 | 1094 | | |
1091 | 1095 | | |
| |||
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
515 | 523 | | |
516 | 524 | | |
517 | 525 | | |
| |||
556 | 564 | | |
557 | 565 | | |
558 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
559 | 570 | | |
560 | 571 | | |
561 | 572 | | |
| |||
571 | 582 | | |
572 | 583 | | |
573 | 584 | | |
574 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
575 | 590 | | |
576 | 591 | | |
577 | 592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1052 | 1052 | | |
1053 | 1053 | | |
1054 | 1054 | | |
1055 | | - | |
| 1055 | + | |
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
| 1059 | + | |
1062 | 1060 | | |
1063 | | - | |
| 1061 | + | |
1064 | 1062 | | |
1065 | 1063 | | |
1066 | 1064 | | |
| |||
1086 | 1084 | | |
1087 | 1085 | | |
1088 | 1086 | | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1089 | 1093 | | |
1090 | 1094 | | |
1091 | 1095 | | |
| |||
0 commit comments