summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_php_sapi.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2020-12-08 01:59:46 +0300
committerValentin Bartenev <vbart@nginx.com>2020-12-08 01:59:46 +0300
commit2348229dc7656f36a7915d85af56aae9ed9fb120 (patch)
tree37f5ce3dcfe6ae4859ce6440765e0b5fa2d4518b /src/nxt_php_sapi.c
parentbda76b04e9aec295c7fa11c7eacb6e11c4bf67f4 (diff)
downloadunit-2348229dc7656f36a7915d85af56aae9ed9fb120.tar.gz
unit-2348229dc7656f36a7915d85af56aae9ed9fb120.tar.bz2
PHP: populating PHP_AUTH_* server variables.
This closes #498 issue on GitHub.
Diffstat (limited to 'src/nxt_php_sapi.c')
-rw-r--r--src/nxt_php_sapi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c
index d2fbdd27..369e7f32 100644
--- a/src/nxt_php_sapi.c
+++ b/src/nxt_php_sapi.c
@@ -1038,6 +1038,17 @@ nxt_php_execute(nxt_php_run_ctx_t *ctx, nxt_unit_request_t *r)
ctx->cookie = nxt_unit_sptr_get(&f->value);
}
+ if (r->authorization_field != NXT_UNIT_NONE_FIELD) {
+ f = r->fields + r->authorization_field;
+
+ php_handle_auth_data(nxt_unit_sptr_get(&f->value));
+
+ } else {
+ SG(request_info).auth_digest = NULL;
+ SG(request_info).auth_user = NULL;
+ SG(request_info).auth_password = NULL;
+ }
+
SG(sapi_headers).http_response_code = 200;
SG(request_info).path_translated = NULL;