jacksonh / manos

Manos is an easy to use, easy to test, high performance web application framework that stays out of your way and makes your life ridiculously simple.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

manos swallows '+' in inputs from multipart/form-data

atsushieno opened this issue · comments

With the foobar app below, enter "a+b" and click "post" button to see the input results. It will show "a b / a b" instead of "a+b / a+b", probably due to URL encoding the inputs. (Two results are from Request.Data["foobar"] and method parameter foobar.)

using Manos;

namespace foobar {
        public class foobar : ManosApp {
                public foobar ()
                {
                        Route ("/Content/", new StaticContentModule ());
                }

                [Route ("/")]
                public void ShowForm (IManosContext ctx)
                {
                        ctx.Response.End (@"
<html> <body> <form action='/send' method='POST' enctype='multipart/form-data'>
<input type='text' name='foobar' />
<input type='submit' value='post' />
</form> </body> </html>");
                }

                [Route ("/send")]
                public void Receive (IManosContext ctx, string foobar)
                {
                        ctx.Response.End ("'{0}' / '{1}'", ctx.Request.Data ["foobar"], foobar);
                }
        }
}

This happens only when multipart/form-data is specified.

This is fixed in master, thanks again.