unusually formed POSTs aren't handled correctly

0 views
Skip to first unread message

harryh

unread,
Nov 14, 2009, 3:36:42 PM11/14/09
to Lift
POST /path/to/page?foo=bar HTTP/1.1
Host: harryh.org
Content-Length: 0

req.param("foo") will return Empty instead of Full("bar")

-harryh

David Pollak

unread,
Nov 14, 2009, 4:10:24 PM11/14/09
to lif...@googlegroups.com
This is defined behaviour in Lift. :-(

And query params are ignored during POST processing.

Does the HTTP or Servlet spec define the appropriate behaviour here?  If Lift is violating either, we'll change Lift.
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

harryh

unread,
Nov 14, 2009, 4:13:51 PM11/14/09
to Lift
Hrm. They are *not* ignored with the following request:

POST /index?foo=bar HTTP/1.1
Host: localhost
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

Will look into the spec.

-harryh

On Nov 14, 4:10 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> This is defined behaviour in Lift. :-(
>
> And query params are ignored during POST processing.
>
> Does the HTTP or Servlet spec define the appropriate behaviour here?  If
> Lift is violating either, we'll change Lift.
>
> On Sat, Nov 14, 2009 at 12:36 PM, harryh <har...@gmail.com> wrote:
>
> > POST /path/to/page?foo=bar HTTP/1.1
> > Host: harryh.org
> > Content-Length: 0
>
> > req.param("foo") will return Empty instead of Full("bar")
>
> > -harryh
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

David Pollak

unread,
Nov 14, 2009, 4:38:23 PM11/14/09
to lif...@googlegroups.com
On Sat, Nov 14, 2009 at 1:13 PM, harryh <har...@gmail.com> wrote:

Hrm.  They are *not* ignored with the following request:

POST /index?foo=bar HTTP/1.1
Host: localhost
Content-Length: 0
Content-Type: application/x-www-form-urlencoded


Okay... I understand what's going on.  Please open a ticket on this.

Basically, we're parsing none of the query params unless the POST is form encoded.  I think the correct behaviour is to parse the query params if there's not Content-Type.
 
Will look into the spec.

-harryh

On Nov 14, 4:10 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> This is defined behaviour in Lift. :-(
>
> And query params are ignored during POST processing.
>
> Does the HTTP or Servlet spec define the appropriate behaviour here?  If
> Lift is violating either, we'll change Lift.
>
> On Sat, Nov 14, 2009 at 12:36 PM, harryh <har...@gmail.com> wrote:
>
> > POST /path/to/page?foo=bar HTTP/1.1
> > Host: harryh.org
> > Content-Length: 0
>
> > req.param("foo") will return Empty instead of Full("bar")
>
> > -harryh
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Reply all
Reply to author
Forward
0 new messages