http: Add ability to disable /httpstatus URI

Add a new configuration option 'enable_status' which allows the
/httpstatus URI handler to be administratively disabled.

We also no longer unconditionally register the /static and /httpstatus
URI handlers, but instead do it based upon configuration.

Behavior change: If enable_static was turned off, the URI handler was
still installed but returned a 403 when it was accessed. Because we
now register/unregister the URI handlers as appropriate, if the
/static URI is disabled we will return a 404 instead.

Additionally:

* Change 'enablestatic' to 'enable_static' but keep the former for
  backwards compatibility.
* Improve some internal variable names

ASTERISK-28710 #close

Change-Id: I647510f796473793b1d3ce1beb32659813be69e1
This commit is contained in:
Sean Bright
2020-01-22 10:39:47 -05:00
parent b073b4318a
commit 0dce6f746b
3 changed files with 53 additions and 17 deletions

View File

@@ -0,0 +1,4 @@
Subject: http
You can now disable the /httpstatus page served by Asterisk's built-in
HTTP server by setting 'enable_status' to 'no' in http.conf.