diff src/luan/modules/http/Http.luan @ 1237:275d1b52dbce

add Request.scheme
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 11 Jun 2018 18:22:51 -0600
parents b6aa2cd51b02
children beebd0f5f2ba
line wrap: on
line diff
--- a/src/luan/modules/http/Http.luan	Fri May 25 00:58:05 2018 -0600
+++ b/src/luan/modules/http/Http.luan	Mon Jun 11 18:22:51 2018 -0600
@@ -30,6 +30,7 @@
 	Http.request = this
 	if java == nil then
 		this.method = "GET"
+		this.scheme = "http"
 		this.headers = {}
 		this.parameters = {}
 		this.cookies = {}
@@ -40,11 +41,11 @@
 		this.raw_path = java.rawPath or error()
 		this.path = java.path or error()
 		this.protocol = java.protocol or error()
+		this.scheme = java.scheme or error()
 		this.headers = JavaLuan.toLuan(java.headers)
 		this.parameters = JavaLuan.toLuan(java.parameters)
 		this.cookies = JavaLuan.toLuan(java.cookies)
 	end
-	this.scheme = "http"
 
 	function this.url()
 		return this.scheme.."://"..this.headers["host"]..this.raw_path