13 Commits

Author SHA1 Message Date
Fractal147
9f4d7a9988 Fixed unnecessary globals as in issue #113. (#122)
* Fixed global assignment that should be local

Made result variable be local, see Issue #113

* Made global variable local

Made ASCII variable be local, see Issue #113

* Made more variables local

Related to Issue #113. questionMarkPos, and b,c,d,e,f all are global in scope, and are not cleared from memory, so leak.
Frankly, b, c, d, e, and f are not used either, but will now get GC'd later, if they ever were assigned, so not problematic
line 114 also has _ and i to make local too, so were put on their own line.
i on line 24 also was unnecessarily global, and undetected in issue #113

* Made module more local

Made the basicAuth table local in scope. Since it is returned when dofile is called in httpserver.lua, that already has a correctly scoped table, 'auth'. This is related to issue #113, and should reduce memory loss to globals

* Made bufferedConnection local

bufferedConnection was global and didn't have to be. Part of issue #113.
Now no longer remains in _G (globals table) after a connection has closed.
2018-01-14 22:03:37 -06:00
Gregor Hartmann
6158d4b5ba support changes json API (#116)
use sjson instead of cjson
Also take care of backward compatibility before 2.1
2017-10-02 11:13:39 -05:00
Gregor
f7bb7303e2 filter invalid requests
sometimes I observe requests which are malformed (seem to be binary
data) so everything that does not have a method and request (url)
defined gets kicked.
2017-05-29 21:10:51 +02:00
Marcos Kirsch
2f2fb26782 Several fixes and code cleanup. Gzipped files now work. Indentation cleaned up, Other small fixes: 2016-02-15 22:52:30 -06:00
Marcos Kirsch
fbc6506faa Merged with main repository 2016-02-15 20:54:11 -06:00
Marcos Kirsch
4ff7b2b78d Trivial placeholder print statement, useful for debugging. 2016-02-15 13:52:27 -06:00
Lukas Humbel
02832a1a45 matching of mime type in http request header that contain a charset appendix 2015-12-19 13:43:55 +01:00
Hazar Karabay
b7f78481a2 File extension parsing fix
If a filename contains dots, extension was parsed as everything after
the first dot.
File extension must be what it is after the last dot.

Also includes a rewrited workaround for mimetypes if the requested file
gzip compressed.
2015-09-16 22:10:21 +03:00
Ryan Voots
ef340bc82a Implement support for more arbitrary HTTP methods. Allows GET PUT and POST. With minor changes needed to support others 2015-08-31 18:28:03 -07:00
TJ Borromeo
91c16d1e24 Remove unnecessary if statements
nil is false in lua, just utilizing that fact.
2015-04-24 15:06:34 -07:00
Artem Pastukhov
a51a4d929b Fixes, fixes 2015-04-02 16:57:26 +03:00
Artem Pastukhov
a37de51189 some fixes 2015-04-02 15:37:40 +03:00
Marcos Kirsch
75ed944678 Refactored server to move request parsing into a separate file. This allows the server to be used in firmware builds with floating point enabled. 2015-03-22 22:02:38 -05:00