Fossil SCM
Reject if both HTTP 1.1 content-length and transfer-encoding headers set.
Commit
63826bf8a4ce7300cf45ff16fe82bcd0b132fdb2a9dc561277776f6e72572828
Parent
bd777e5d19d736b…
1 file changed
+6
+6
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -755,10 +755,16 @@ | ||
| 755 | 755 | if( rc!=200 ){ |
| 756 | 756 | if( mHttpFlags & HTTP_QUIET ) goto write_err; |
| 757 | 757 | fossil_warning("\"location:\" missing from %d redirect reply", rc); |
| 758 | 758 | goto write_err; |
| 759 | 759 | } |
| 760 | + | |
| 761 | + if( isChunked && iLength>=0 ){ | |
| 762 | + /* RFC 7230 says to reject in this case */ | |
| 763 | + fossil_warning("reply has both content-length and transfer-encoding"); | |
| 764 | + goto write_err; | |
| 765 | + } | |
| 760 | 766 | |
| 761 | 767 | /* |
| 762 | 768 | ** Extract the reply payload that follows the header |
| 763 | 769 | */ |
| 764 | 770 | blob_zero(pReply); |
| 765 | 771 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -755,10 +755,16 @@ | |
| 755 | if( rc!=200 ){ |
| 756 | if( mHttpFlags & HTTP_QUIET ) goto write_err; |
| 757 | fossil_warning("\"location:\" missing from %d redirect reply", rc); |
| 758 | goto write_err; |
| 759 | } |
| 760 | |
| 761 | /* |
| 762 | ** Extract the reply payload that follows the header |
| 763 | */ |
| 764 | blob_zero(pReply); |
| 765 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -755,10 +755,16 @@ | |
| 755 | if( rc!=200 ){ |
| 756 | if( mHttpFlags & HTTP_QUIET ) goto write_err; |
| 757 | fossil_warning("\"location:\" missing from %d redirect reply", rc); |
| 758 | goto write_err; |
| 759 | } |
| 760 | |
| 761 | if( isChunked && iLength>=0 ){ |
| 762 | /* RFC 7230 says to reject in this case */ |
| 763 | fossil_warning("reply has both content-length and transfer-encoding"); |
| 764 | goto write_err; |
| 765 | } |
| 766 | |
| 767 | /* |
| 768 | ** Extract the reply payload that follows the header |
| 769 | */ |
| 770 | blob_zero(pReply); |
| 771 |