Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WWSympa: Conform some fields in HTTP responses to current standards #1679

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/cgi/wwsympa.fcgi.in
Original file line number Diff line number Diff line change
Expand Up @@ -2275,22 +2275,23 @@ sub check_action_parameters {
sub send_html {
my $tt2_file = shift;

## Send HTML headers
if ($param->{'date'}) {
printf "Date: %s\n",
DateTime->now->strftime("%a, %{day} %b %Y %H:%M:%S GMT");
}
## If we set the header indicating the last time the file to send was
## modified, add an HTTP header (limitate web harvesting).
# Send HTTP header

printf "Date: %s\n", DateTime->now->strftime("%a, %d %b %Y %H:%M:%S GMT");
# If we indicate the last time the file to send was modified, add it
# as an HTTP header field to limitate web harvesting.
if ($param->{'header_date'}) {
printf "Last-Modified: %s\n",
DateTime->from_epoch(epoch => $param->{'header_date'})
->strftime("%a, %{day} %b %Y %H:%M:%S GMT");
->strftime("%a, %d %b %Y %H:%M:%S GMT");
}
print "Cache-control: max-age=0\n" unless $param->{'action'} eq 'arc';
# Prevent caching responses except archives.
# "max-age=0" is a workaround for very old HTTP/1.0 proxies.
print "Cache-Control: no-store, max-age=0\n"
unless $param->{'action'} eq 'arc';
print "Content-Type: text/html; charset=utf-8\n";
## Workaround for Internet Explorer 8 or later.
print "X-UA-Compatible: IE=100\n";
# No longer needed: Workaround for Internet Explorer 8 or later.
#print "X-UA-Compatible: IE=100\n";

## Notify crash to client.
if ($param->{'action'} eq 'crash') {
Expand Down