summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2019-05-30 15:02:07 +0300
committerMax Romanov <max.romanov@nginx.com>2019-05-30 15:02:07 +0300
commit6a2928b4bf3c57685b707c17eb0c147d68be1dd6 (patch)
treea88b3b48dd46ea7892d4b6272d7b1c696ab32430 /src
parentc4ed3025b33711d09baf1a9c463c9d47cac67f07 (diff)
downloadunit-6a2928b4bf3c57685b707c17eb0c147d68be1dd6.tar.gz
unit-6a2928b4bf3c57685b707c17eb0c147d68be1dd6.tar.bz2
Java: fixing request scheme using 'tls' flag.
Diffstat (limited to '')
-rw-r--r--src/java/nginx/unit/Request.java2
-rw-r--r--src/java/nxt_jni_Request.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/java/nginx/unit/Request.java b/src/java/nginx/unit/Request.java
index b46d3f59..3ba46f6c 100644
--- a/src/java/nginx/unit/Request.java
+++ b/src/java/nginx/unit/Request.java
@@ -920,7 +920,7 @@ public class Request implements HttpServletRequest, DynamicPathRequest
@Override
public String getScheme()
{
- log("getScheme");
+ trace("getScheme");
return getScheme(req_ptr);
}
diff --git a/src/java/nxt_jni_Request.c b/src/java/nxt_jni_Request.c
index a9fbe0e4..733290dd 100644
--- a/src/java/nxt_jni_Request.c
+++ b/src/java/nxt_jni_Request.c
@@ -542,7 +542,11 @@ nxt_java_Request_getRemotePort(JNIEnv *env, jclass cls, jlong req_ptr)
static jstring JNICALL
nxt_java_Request_getScheme(JNIEnv *env, jclass cls, jlong req_ptr)
{
- return (*env)->NewStringUTF(env, "http");
+ nxt_unit_request_t *r;
+
+ r = nxt_jlong2ptr(req_ptr);
+
+ return (*env)->NewStringUTF(env, r->tls ? "https" : "http");
}