Fossil SCM

Avoid returning empty ETag: headers in the HTTP reply.

drh 2020-05-10 11:39 trunk
Commit 261052c4e1c904dafe838b8660c56a73d97b6a9b8e8ff1baf4df0e6df38d4e2a
1 file changed +1 -1
+1 -1
--- src/cgi.c
+++ src/cgi.c
@@ -293,11 +293,11 @@
293293
}
294294
if( g.isConst ){
295295
/* isConst means that the reply is guaranteed to be invariant, even
296296
** after configuration changes and/or Fossil binary recompiles. */
297297
fprintf(g.httpOut, "Cache-Control: max-age=31536000\r\n");
298
- }else if( etag_tag()!=0 ){
298
+ }else if( etag_tag()[0]!=0 ){
299299
fprintf(g.httpOut, "ETag: %s\r\n", etag_tag());
300300
fprintf(g.httpOut, "Cache-Control: max-age=%d\r\n", etag_maxage());
301301
}else{
302302
fprintf(g.httpOut, "Cache-control: no-cache\r\n");
303303
}
304304
--- src/cgi.c
+++ src/cgi.c
@@ -293,11 +293,11 @@
293 }
294 if( g.isConst ){
295 /* isConst means that the reply is guaranteed to be invariant, even
296 ** after configuration changes and/or Fossil binary recompiles. */
297 fprintf(g.httpOut, "Cache-Control: max-age=31536000\r\n");
298 }else if( etag_tag()!=0 ){
299 fprintf(g.httpOut, "ETag: %s\r\n", etag_tag());
300 fprintf(g.httpOut, "Cache-Control: max-age=%d\r\n", etag_maxage());
301 }else{
302 fprintf(g.httpOut, "Cache-control: no-cache\r\n");
303 }
304
--- src/cgi.c
+++ src/cgi.c
@@ -293,11 +293,11 @@
293 }
294 if( g.isConst ){
295 /* isConst means that the reply is guaranteed to be invariant, even
296 ** after configuration changes and/or Fossil binary recompiles. */
297 fprintf(g.httpOut, "Cache-Control: max-age=31536000\r\n");
298 }else if( etag_tag()[0]!=0 ){
299 fprintf(g.httpOut, "ETag: %s\r\n", etag_tag());
300 fprintf(g.httpOut, "Cache-Control: max-age=%d\r\n", etag_maxage());
301 }else{
302 fprintf(g.httpOut, "Cache-control: no-cache\r\n");
303 }
304

Keyboard Shortcuts

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