Skip to content

Commit c08227d

Browse files
committed
http: disable display_errors option by default
When option 'display_errors' is enabled httpd return application errors and backtraces to the client (like PHP). It is unexpected that the debugging information is sent to a client by default. It is usual to have such option, but have it disabled by default: see Django's DEBUG setting [1] for example. 1. https://docs.djangoproject.com/en/3.2/ref/settings/#debug Part of tarantool/security#8
1 parent 000efa7 commit c08227d

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- Disable option display_errors by default.
12+
913
## [1.1.1] - 2021-10-28
1014

1115
### Changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ httpd = require('http.server').new(host, port[, { options } ])
123123
* `charset` - the character set for server responses of
124124
type `text/html`, `text/plain` and `application/json`.
125125
* `display_errors` - return application errors and backtraces to the client
126-
(like PHP).
126+
(like PHP). Disabled by default (since 1.2.0).
127127
* `log_requests` - log incoming requests. This parameter can receive:
128128
- function value, supporting C-style formatting: log_requests(fmt, ...), where fmt is a format string and ... is Lua Varargs, holding arguments to be replaced in fmt.
129129
- boolean value, where `true` choose default `log.info` and `false` disable request logs at all.

http/server.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ local exports = {
12891289
cache_static = true,
12901290
log_requests = true,
12911291
log_errors = true,
1292-
display_errors = true,
1292+
display_errors = false,
12931293
}
12941294

12951295
local self = {

test/integration/http_server_requests_test.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ local helpers = require('test.helpers')
77
local g = t.group()
88

99
g.before_each(function()
10-
g.httpd = helpers.cfgserv()
10+
g.httpd = helpers.cfgserv({
11+
display_errors = true,
12+
})
1113
g.httpd:start()
1214
end)
1315

0 commit comments

Comments
 (0)