Closed atsushieno closed 13 years ago
Ugh, the repro code sanitizer swallowed almost entire report :( Let me repeat it:
manos does not handle form entries when there is an empty input text.
Repro:
1) manos -init foobar 2) Add the following methods in foobar.cs
[Route ("/")]
public void Index (IManosContext ctx)
{
ctx.Response.End ("<html><body><form action='/a' method='POST'> <input type='text' name='x' /> <input type='text' name='y' /> <input type='submit' value='send' /> </body></html>");
}
[Route ("/a")]
public void ProcessPost (IManosContext ctx)
{
ctx.Response.End ("x = {0}, y = {1}",
ctx.Request.Data ["x"],
ctx.Request.Data ["y"]);
}
3) run manos -build and manos -server 4) go to http://localhost:8080 5) Enter '1' only in the second textbox and click "send"
It prints "x = , y = " which should actually be "x = , y = 1"
The following change fixes the issue:
--- a/src/Manos/Manos.Http/HttpFormDataHandler.cs +++ b/src/Manos/Manos.Http/HttpFormDataHandler.cs @@ -88,8 +88,6 @@ namespace Manos.Http { private void FinishPair (HttpEntity entity) { - if (value_buffer.Length == 0) - return;
Fixed, thanks.
manos does not handle form entries when there is an empty input text.
Repro:
1) manos -init foobar 2) Add the following methods in foobar.cs