Java: fixing request scheme using 'tls' flag.

This commit is contained in:
Max Romanov
2019-05-30 15:02:07 +03:00
parent c4ed3025b3
commit 6a2928b4bf
2 changed files with 6 additions and 2 deletions

View File

@@ -920,7 +920,7 @@ public class Request implements HttpServletRequest, DynamicPathRequest
@Override
public String getScheme()
{
log("getScheme");
trace("getScheme");
return getScheme(req_ptr);
}

View File

@@ -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");
}