Mercurial Hosting > luan
comparison http/src/luan/modules/http/run.luan @ 498:ee55be414a34
Http.response is now mostly luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 18 May 2015 00:25:35 -0600 |
parents | 55f9f74f1e55 |
children | 92c3d22745b8 |
comparison
equal
deleted
inserted
replaced
497:55f9f74f1e55 | 498:ee55be414a34 |
---|---|
54 form() | 54 form() |
55 return | 55 return |
56 end | 56 end |
57 local content_type = Http.request.parameter.content_type | 57 local content_type = Http.request.parameter.content_type |
58 if content_type ~= nil then | 58 if content_type ~= nil then |
59 Http.response.content_type = content_type | 59 Http.response.header.content_type = content_type |
60 end | 60 end |
61 local env = { | 61 local env = { |
62 request = Http.request; | 62 request = Http.request; |
63 response = Http.response; | 63 response = Http.response; |
64 } | 64 } |
66 function() | 66 function() |
67 local run = load(code,"<web_run>",env) | 67 local run = load(code,"<web_run>",env) |
68 run() | 68 run() |
69 end; | 69 end; |
70 catch = function(e) | 70 catch = function(e) |
71 Http.response.content_type = "text/plain" | 71 Http.response.header.content_type = "text/plain" |
72 print(e) | 72 print(e) |
73 print() | 73 print() |
74 print() | 74 print() |
75 print_with_line_numbers(code) | 75 print_with_line_numbers(code) |
76 end; | 76 end; |