1
0
mirror of https://github.com/graygnuorg/pound.git synced 2026-10-23 22:28:53 +03:00
Files
pound/tests/error.at
Sergey Poznyakoff aeda6aaced Version 4.19.90
2026-01-24 18:39:34 +02:00

137 lines
2.2 KiB
Plaintext

# This file is part of pound testsuite. -*- autotest -*-
# Copyright (C) 2023-2026 Sergey Poznyakoff
#
# Pound is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Pound is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pound. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([Error backend])
AT_KEYWORDS([error])
PT_CHECK([ListenHTTP
Service
Error 404
End
End
],
[GET /foo/bar
end
404
Content-Type: text/html
Expires: now
Pragma: no-cache
Cache-control: no-cache,no-store
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL was not found on this server.</p></body></html>
endnonl
])
m4_pushdef([ERR404],
[<html>
<head><title>Custom Not Found Error</title></head>
<body>
<p>The requested resource is not found on that server.</p>
<p>This custom error page was supplied using the ErrorFile directive.</p>
</body>])
AT_DATA([404.html],[ERR404
])
AT_DATA([404.txt],[Content-Type: text/plain
Cache-Control: no-cache
ERR404
])
PT_CHECK([ListenHTTP
ErrorFile 404 "404.html"
Service
Error 404
End
End
],
[GET /foo/bar
end
404
Content-Type: text/html
Expires: now
Pragma: no-cache
Cache-control: no-cache,no-store
ERR404
end
])
PT_CHECK([ListenHTTP
Service
Error 404 "404.html"
End
End
],
[GET /foo/bar
end
404
Content-Type: text/html
Expires: now
Pragma: no-cache
Cache-control: no-cache,no-store
ERR404
end
])
PT_CHECK([ListenHTTP
ErrorFile 404 "404.txt"
Service
Error 404
End
End
],
[GET /foo/bar
end
404
content-type: text/plain
Expires: now
Pragma: no-cache
Cache-control: no-cache
ERR404
end
])
PT_CHECK([ListenHTTP
Service
Error 404 "404.txt"
End
End
],
[GET /foo/bar
end
404
content-type: text/plain
Expires: now
Pragma: no-cache
Cache-control: no-cache
ERR404
end
])
m4_popdef([ERR404])
AT_CLEANUP