0x50f13 / meowmeow Goto Github PK
View Code? Open in Web Editor NEWTiny webserver written in erlang
License: MIT License
Tiny webserver written in erlang
License: MIT License
Server kills connection even when data is written in it. So this leads to error:
ERROR|Mon, 14 Jun 2021 13:28:18 GMT:Failed to send packet: {error,{closed,<<...>>}} @ io_proxy:tcp_send/2
Send-File
when responding to request behaves as if connection iskeep-alive
ignoring that it may be close
connection.
Exception:
Error in process <0.495.0> on node 'MeowMeow@e28340418539' with exit value:
{{badkey,"Host"},
[{erlang,map_get,
["Host",
#{body => [],http_ver => <<"HTTP/1.0">>,method => <<"GET">>,
route => <<"/nice%20ports%2C/Tri%6Eity.txt%2ebak">>,
"body" => <<>>}],
[{error_info,#{module => erl_erts_errors}}]},
{access,get_rules_checked,4,[{file,"/buildroot/src/access.erl"},{line,79}]},
{handle,handle,2,[{file,"/buildroot/src/handle.erl"},{line,184}]},
{handle,handler,3,[{file,"/buildroot/src/handle.erl"},{line,251}]}]}
The following should be investigated:
HTTP/1.0
400 Bad request
The script for testing a web server with help of GitHub CI should be developed.
The webserver produces a lot of debug messages which make request handling slower. As the code grows the amount of messages which are sent to logs also grows. So it might be beneficial in future to separate logging in another process in order to deliver response as fast as possible.
Describe the bug
When client does HTTP/1.0
request to server with Hosts
handling configured the exception on server occurs.
To Reproduce
Any HTTP/1.0
request without Hosts
header to MeowMeow server where Hosts
handling is configured.
Expected behavior
No exception should occur.
OS & client (please complete the following information):
Unknown
Logs
=ERROR REPORT==== 9-Jul-2021::06:28:11.395303 ===
Error in process <0.1905.0> on node 'MeowMeow@ef6b9abe815b' with exit value:
{{badmatch,ok},
[{handle,do_rules,2,[{file,"/buildroot/src/handle.erl"},{line,76}]},
{handle,handle,2,[{file,"/buildroot/src/handle.erl"},{line,198}]},
{handle,handler,3,[{file,"/buildroot/src/handle.erl"},{line,272}]}]}
Describe the bug
When Default
rule is used the headers are cleaned, and only Connection
is sent. Thise leads to lack of Content-length
header and so browser failing to finalize request correctly.
To Reproduce
In config apply Default
rule to some route. Request this route through any client.
Expected behavior
The header MUST NOT be cleaned when using Default
rule
OS & client (please complete the following information):
As mentioned in issue #7 in order to overcome difficulties with parsing extra space quotes should be introduced.
In order to make webserver more flexible the ability for loading rule handlers from separate modules should be implemented.
When the some folder is requested, the server tries to find and send index.html
, but if there is no index.html
server attempts to read file with name of folder which leads to error.
So if there is no index.html
in folder server should send HTTP/1.1 404 Not Found
Testing GET /catnip
with Route /catnip
in routes.conf
results into rules not being added to list of processing
In Send-File
directive wrong path to file(i.e. non-existent or irregular) causes handler process to die with exception. The proper handling of such a misconfiguration should include:
Additionally the same issue was with memory, but fix is almost ready
Server tries to handle get parameters as a file name, i.e. for /foo/bar?a=b
it tries to find a file bar?a=b
. Server should split get params and attach them to request
record instead of attaching it to filename.
Rules handler receives host header with space before it. Instead leading space should be removed.
Example:
Request contains Host: example.org
, so rules handler get " example.org"
instead of "example.org"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.