Ticket #147 (closed defect: fixed)

Opened 9 months ago

Last modified 6 months ago

Empty result when returning anything besides 200

Reported by: whateley Owned by: somebody
Priority: major Milestone:
Component: camping.rb Version:
Keywords: Cc:

Description (last modified by whateley) (diff)

When I try to return a 401 or a 404 (I haven't tested anything else), regardless of what headers or content I set, all I get back as a result is:

HTTP/1.1 200 OK
Content-Length: 0
Date: Thu, 22 Nov 2007 04:24:37 GMT
Server: thoth

When running under bin/camping or downgrading camping to 1.5.180, everything works fine.

camping-1.5.238 on lighttpd 1.4.18, FastCGI

Change History

Changed 9 months ago by whateley

  • description modified (diff)

Changed 9 months ago by whateley

I've tracked this down; the bug first occurs in [224].

Changed 9 months ago by whateley

[239] doesn't actually fix this.

This line:

(headers.map{|k,v|[*v].map{|x|[k,v]*": "}}*Z).gsub(Z*2,Z)+Z+Z

should actually be:

(headers.map{|k,v|[*v].map{|x|[k,v]*": "}}*Z+Z).gsub(Z*2,Z)+Z

Because otherwise you'll never end up with Z*2 inside the parentheses, and any superfluous CRLF at the end gets missed.

What's that inner map for anyways? The x never seems to be used, and if you pass an array in one of the headers you get:

Header: item1: item2

which is just weird.

Changed 8 months ago by zimbatm

  • status changed from new to closed
  • resolution set to fixed

Should be fixed in [240].

Changed 6 months ago by archengule

  • status changed from closed to reopened
  • resolution deleted

{240} just raised more problems. See #152. Using whateley's suggestion seems to work for me. See patch attached to #152

Changed 6 months ago by archengule

Woops. I mean '[240] raised more problems'

Changed 6 months ago by zimbatm

Hey, thanks for the contributions.

Sorry for [240]. This commit doesn't even make sense. I don't know what happened...

If I didn't use whateley's solution, there must be a reason although. I believe the .gsub is just a hack that doesn't work in all cases. To be investigated...

Changed 6 months ago by zimbatm

Ok, can you try [242] ?

Changed 6 months ago by archengule

  • status changed from reopened to closed
  • resolution set to fixed

Brilliant, thanks!

Note: See TracTickets for help on using tickets.