Mercurial Hosting > luan
diff src/luan/modules/http/Http.luan @ 1260:4b5b84853f6f
replace Table.as_table with Luan.to_table
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 23 Sep 2018 22:32:34 -0600 |
parents | e8020216dee7 |
children | 198d6af7330a |
line wrap: on
line diff
--- a/src/luan/modules/http/Http.luan Sun Sep 23 17:58:40 2018 -0600 +++ b/src/luan/modules/http/Http.luan Sun Sep 23 22:32:34 2018 -0600 @@ -25,10 +25,9 @@ local Http = {} -local old_java_to_luan = Luan.java_to_luan or error() +local old_to_table = Luan.to_table or error() -local function java_to_luan(obj) - obj = old_java_to_luan(obj) +local function to_table(obj) if type(obj)=="java" and obj.instanceof(Request.MultipartFile) then return { filename = obj.filename @@ -36,7 +35,7 @@ content = obj.content } end - return obj + return old_to_table(obj) end function Http.new_request(java) @@ -57,7 +56,7 @@ this.protocol = java.protocol or error() this.scheme = java.scheme or error() this.headers = to_luan(java.headers) - this.parameters = to_luan(java.parameters,java_to_luan) + this.parameters = to_luan(java.parameters,to_table) this.cookies = to_luan(java.cookies) end