Fossil SCM

Do not send the message body on an HTTP reply to a HEAD request.

drh 2017-07-04 13:11 trunk
Commit 5826ba37acff82bba06df835ad8b21b2e66aa6985abad79875235f075c004b1b
1 file changed +3 -1
+3 -1
--- src/cgi.c
+++ src/cgi.c
@@ -382,11 +382,13 @@
382382
fprintf(g.httpOut, "Content-Length: %d\r\n", total_size);
383383
}else{
384384
total_size = 0;
385385
}
386386
fprintf(g.httpOut, "\r\n");
387
- if( total_size>0 && iReplyStatus != 304 ){
387
+ if( total_size>0 && iReplyStatus != 304
388
+ && fossil_strcmp(P("REQUEST_METHOD"),"HEAD")!=0
389
+ ){
388390
int i, size;
389391
for(i=0; i<2; i++){
390392
size = blob_size(&cgiContent[i]);
391393
if( size>0 ){
392394
fwrite(blob_buffer(&cgiContent[i]), 1, size, g.httpOut);
393395
--- src/cgi.c
+++ src/cgi.c
@@ -382,11 +382,13 @@
382 fprintf(g.httpOut, "Content-Length: %d\r\n", total_size);
383 }else{
384 total_size = 0;
385 }
386 fprintf(g.httpOut, "\r\n");
387 if( total_size>0 && iReplyStatus != 304 ){
 
 
388 int i, size;
389 for(i=0; i<2; i++){
390 size = blob_size(&cgiContent[i]);
391 if( size>0 ){
392 fwrite(blob_buffer(&cgiContent[i]), 1, size, g.httpOut);
393
--- src/cgi.c
+++ src/cgi.c
@@ -382,11 +382,13 @@
382 fprintf(g.httpOut, "Content-Length: %d\r\n", total_size);
383 }else{
384 total_size = 0;
385 }
386 fprintf(g.httpOut, "\r\n");
387 if( total_size>0 && iReplyStatus != 304
388 && fossil_strcmp(P("REQUEST_METHOD"),"HEAD")!=0
389 ){
390 int i, size;
391 for(i=0; i<2; i++){
392 size = blob_size(&cgiContent[i]);
393 if( size>0 ){
394 fwrite(blob_buffer(&cgiContent[i]), 1, size, g.httpOut);
395

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button