Ticket #112 (closed defect)

Opened 20 months ago

Last modified 17 months ago

No way to get raw request body

Reported by: whateley Owned by: why
Priority: major Milestone:
Component: bin/camping Version: 1.5
Keywords: Cc: whateley@…

Description

As far as I can tell there's no good way to get at the body of a request (which I need to do to implement the Atom Publishing Protocol).

@in.rewind; @in.read works fine until I switch to FastCGI; apparently FCGI::Stream has no rewind method.

Attachments

camping-1.5.180-request-body.patch (466 bytes) - added by whateley 19 months ago.
CONTENT_TYPE rather than HTTP_CONTENT_TYPE

Change History

Changed 19 months ago by mst

How about

elsif 'application/x-www-form-urlencoded' == e.CONTENT_TYPE
  qs.merge!(C.qsp(@in.read))
elsif @method == "post"
 qs['raw_post'] = @in.read
end

Changed 19 months ago by whateley

The attached patch solves this problem (it removing the need for a rewind) and another problem I ran into with non-form-encoded POST bodies containing &s.

(mst's solution works too, except for the POST-specific bits. wouldn't want to leave PUT in the cold.)

Changed 19 months ago by whateley

Mosquito doesn't set @requestHTTP_CONTENT_TYPE?, so my patch breaks it.

Changed 19 months ago by whateley

CONTENT_TYPE rather than HTTP_CONTENT_TYPE

Changed 17 months ago by why

  • status changed from new to closed

Great. Very good!

Note: See TracTickets for help on using tickets.