mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
r7017: added a esp variable server['TLS_SUPPORT'] which tells the script if the server
can support TLS. This will allow us to auto-redirect if a user connects using the
wrong protocol
(This used to be commit fbf4552cd5
)
This commit is contained in:
parent
f466b72222
commit
67a38fc159
@ -409,6 +409,7 @@ invalid:
|
||||
static void http_setup_arrays(struct esp_state *esp)
|
||||
{
|
||||
struct websrv_context *web = esp->web;
|
||||
struct esp_data *edata = talloc_get_type(web->task->private, struct esp_data);
|
||||
struct EspRequest *req = esp->req;
|
||||
char *p;
|
||||
|
||||
@ -424,6 +425,7 @@ static void http_setup_arrays(struct esp_state *esp)
|
||||
SETVAR(ESP_REQUEST_OBJ, "REQUEST_URI", web->input.url);
|
||||
p = strrchr(web->input.url, '/');
|
||||
SETVAR(ESP_REQUEST_OBJ, "SCRIPT_NAME", p+1);
|
||||
SETVAR(ESP_REQUEST_OBJ, "SCRIPT_FILENAME", web->input.url);
|
||||
p = socket_get_peer_name(web->conn->socket, esp);
|
||||
SETVAR(ESP_REQUEST_OBJ, "REMOTE_HOST", p);
|
||||
SETVAR(ESP_REQUEST_OBJ, "REMOTE_ADDR", p);
|
||||
@ -450,7 +452,7 @@ static void http_setup_arrays(struct esp_state *esp)
|
||||
SETVAR(ESP_SERVER_OBJ, "SERVER_PROTOCOL", web->tls_session?"https":"http");
|
||||
SETVAR(ESP_SERVER_OBJ, "SERVER_SOFTWARE", "SWAT");
|
||||
SETVAR(ESP_SERVER_OBJ, "GATEWAY_INTERFACE", "CGI/1.1");
|
||||
SETVAR(ESP_REQUEST_OBJ, "SCRIPT_FILENAME", web->input.url);
|
||||
SETVAR(ESP_SERVER_OBJ, "TLS_SUPPORT", edata->tls_data?"True":"False");
|
||||
}
|
||||
|
||||
#if HAVE_SETJMP_H
|
||||
|
Loading…
Reference in New Issue
Block a user