Mercurial Hosting > luan
comparison src/luan/modules/http/tools/run.luan @ 1165:668f29bc52ea
clean up content-type
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 07 Feb 2018 23:16:12 -0700 |
parents | 21d157b153fe |
children | 5dbb552075ff |
comparison
equal
deleted
inserted
replaced
1164:1f9d34a6f308 | 1165:668f29bc52ea |
---|---|
59 </style> | 59 </style> |
60 </head> | 60 </head> |
61 <body> | 61 <body> |
62 <h2>Run Luan Code</h2> | 62 <h2>Run Luan Code</h2> |
63 <form name="form0" method="post"> | 63 <form name="form0" method="post"> |
64 <input type="hidden" name="content_type" value="text/plain" /> | 64 <input type="hidden" name="content_type" value="text/plain; charset=utf-8" /> |
65 <div> | 65 <div> |
66 <textarea name="code" rows="20" cols="90" wrap="off" autofocus></textarea> | 66 <textarea name="code" rows="20" cols="90" wrap="off" autofocus></textarea> |
67 </div> | 67 </div> |
68 <div> | 68 <div> |
69 <input type="submit" value="Execute Luan Code"/> | 69 <input type="submit" value="Execute Luan Code"/> |
89 local run = load(code,"<web_run>") | 89 local run = load(code,"<web_run>") |
90 run() | 90 run() |
91 end; | 91 end; |
92 catch = function(e) | 92 catch = function(e) |
93 Http.response.reset() | 93 Http.response.reset() |
94 Http.response.headers["content-type"] = "text/plain" | 94 Http.response.headers["content-type"] = "text/plain; charset=utf-8" |
95 Io.stdout = Http.response.text_writer() | 95 Io.stdout = Http.response.text_writer() |
96 print(e) | 96 print(e) |
97 print"" | 97 print"" |
98 print"" | 98 print"" |
99 print_with_line_numbers(code) | 99 print_with_line_numbers(code) |