]> cat aescling's git repositories - httpd-execline.git/commitdiff
Fix minimal cacheing support live origin/HEAD origin/live
authorcat æscling <11325618-aescling@users.noreply.gitlab.com>
Tue, 30 Apr 2024 02:50:55 +0000 (02:50 +0000)
committercat æscling <11325618-aescling@users.noreply.gitlab.com>
Tue, 30 Apr 2024 02:50:55 +0000 (02:50 +0000)
* Furgot to push local changes to origin befur merging!
* Fix Cache-Control header

visible-to-httpd/binaries/httpd.execline

index cf55de16169b307791661eea82630df5e82f6b10..bc77d4bff4baddfa6b5eadf7f86d5fb7153edb94 100755 (executable)
@@ -117,10 +117,10 @@ if -X -n -t {
        backtick -D "no-cache" Cache-Control {
                if { eltest -v HTTPD_EXECLINE_GENERATE_ETAGS }
                        importas -D "604800" -u HTTPD_EXECLINE_MAX_AGE HTTPD_EXECLINE_MAX_AGE
-                       s6-echo -n -- ${HTTPD_EXECLINE_MAX_AGE}
+                       s6-echo -n -- max-age=${HTTPD_EXECLINE_MAX_AGE}
        }
 
-       backtick -D "" optional_etag_line {
+       backtick -D "" Etag {
                if { eltest -v HTTPD_EXECLINE_GENERATE_ETAGS }
                        backtick -i -E -n cksum {
                                redirfd -r 0 supported_domains/${resource}
@@ -129,7 +129,7 @@ if -X -n -t {
                        case -N -- ${cksum} {
                                "^([^ ]+) .*$" {
                                        importas -i -u actual_cksum 1
-                                       s6-echo -n -- "Etag: "${actual_cksum}"\r\n"
+                                       s6-echo -n -- ${actual_cksum}
                                }
                        }
                        s6-echo -n -- ''
@@ -217,19 +217,19 @@ if -X -n -t {
                importas -i -u Content-Encoding Content-Encoding
                importas -i -u Content-Length Content-Length
                importas -i -u Content-Type Content-Type
-               importas -i -u optional_etag_line optional_etag_line
+               importas -i -u Etag Etag
                importas -i -u Date Date
                importas -i -u Last-Modified Last-Modified
                importas -i -u extra_headers extra_headers
        }
-       if { log.execline line is ${optional_etag_line} }
        if {
                s6-echo -n -- "HTTP/1.1 "${status_code_and_message}"\r
 Content-Encoding: "${Content-Encoding}"\r
 Content-Type: "${Content-Type}"\r
 Content-Length: "${Content-Length}"\r
 Cache-Control: "${Cache-Control}"\r
-"${optional_etag_line}"\r\nLast-Modified: "${Last-Modified}"\r
+Etag: "${Etag}"\r
+Last-Modified: "${Last-Modified}"\r
 Date: "${Date}${extra_headers}"
 \r
 "