diff options
author | Johannes Weißl <[email protected]> | 2013-06-22 20:21:45 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-02-05 10:32:23 +0100 |
commit | 79377d58e3f42a3f866998f2135c42c05a51d945 (patch) | |
tree | 7622a79225114e5270da43cc5ecf3fbbd1b271a8 | |
parent | 1623d54ce6a552eb6802519c0ffe1f3616fab4aa (diff) | |
download | otp-79377d58e3f42a3f866998f2135c42c05a51d945.tar.gz otp-79377d58e3f42a3f866998f2135c42c05a51d945.tar.bz2 otp-79377d58e3f42a3f866998f2135c42c05a51d945.zip |
Fix httpd config option 'erl_script_nocache'
This fixes the usage of the httpd configuration option
'erl_script_nocache', which got ignored before.
Attention: Before, the option 'script_nocache' also changed the
behavior for mod_esi, now it only affects mod_cgi.
-rw-r--r-- | lib/inets/src/http_server/httpd_response.erl | 6 | ||||
-rw-r--r-- | lib/inets/src/http_server/mod_cgi.erl | 2 | ||||
-rw-r--r-- | lib/inets/src/http_server/mod_esi.erl | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/inets/src/http_server/httpd_response.erl b/lib/inets/src/http_server/httpd_response.erl index 6b6532266b..a45b04f275 100644 --- a/lib/inets/src/http_server/httpd_response.erl +++ b/lib/inets/src/http_server/httpd_response.erl @@ -20,7 +20,7 @@ -module(httpd_response). -export([generate_and_send_response/1, send_status/3, send_header/3, send_body/3, send_chunk/3, send_final_chunk/2, split_header/2, - is_disable_chunked_send/1, cache_headers/1]). + is_disable_chunked_send/1, cache_headers/2]). -export([map_status_code/2]). -include("httpd.hrl"). @@ -266,8 +266,8 @@ get_connection(false,"HTTP/1.1") -> get_connection(_,_) -> "". -cache_headers(#mod{config_db = Db}) -> - case httpd_util:lookup(Db, script_nocache, false) of +cache_headers(#mod{config_db = Db}, NoCacheType) -> + case httpd_util:lookup(Db, NoCacheType, false) of true -> Date = httpd_util:rfc1123_date(), [{"cache-control", "no-cache"}, diff --git a/lib/inets/src/http_server/mod_cgi.erl b/lib/inets/src/http_server/mod_cgi.erl index c854166c29..f1b73810e6 100644 --- a/lib/inets/src/http_server/mod_cgi.erl +++ b/lib/inets/src/http_server/mod_cgi.erl @@ -295,7 +295,7 @@ receive_headers(Port, Module, Function, Args, Timeout) -> end. send_headers(ModData, {StatusCode, _}, HTTPHeaders) -> - ExtraHeaders = httpd_response:cache_headers(ModData), + ExtraHeaders = httpd_response:cache_headers(ModData, script_nocache), httpd_response:send_header(ModData, StatusCode, ExtraHeaders ++ HTTPHeaders). diff --git a/lib/inets/src/http_server/mod_esi.erl b/lib/inets/src/http_server/mod_esi.erl index e36c33b282..b11df34f9e 100644 --- a/lib/inets/src/http_server/mod_esi.erl +++ b/lib/inets/src/http_server/mod_esi.erl @@ -440,7 +440,7 @@ receive_headers(Timeout) -> end. send_headers(ModData, StatusCode, HTTPHeaders) -> - ExtraHeaders = httpd_response:cache_headers(ModData), + ExtraHeaders = httpd_response:cache_headers(ModData, erl_script_nocache), httpd_response:send_header(ModData, StatusCode, ExtraHeaders ++ HTTPHeaders). |