0

I checked mochiweb response headers, and they are always ordered (descending):

< Server: MochiWeb/1.0 (Any of you quaids got a smint?)
< last-modified: Sun, 30 Aug 2015 23:13:04 GMT
< Date: Sun, 30 Aug 2015 23:15:15 GMT
< Content-Type: text/html
< Content-Length: 89

This looks to be because of mochiweb headers are being handled with an erlang gb_tree, which is later converted to a list so it comes ordered.

Is there a way to change this? as this could resolve in problems (sometimes) like here and here

My problem is that I am trying to create a service that replicates some requests and I am using mochiweb for this, but Headers are being ordered so it isn't completely replicating the response correctly.

Community
  • 1
  • 1
eLRuLL
  • 18,488
  • 9
  • 73
  • 99
  • Short of replacing the implementation in [mochiweb_headers.erl](https://github.com/mochi/mochiweb/blob/master/src/mochiweb_headers.erl) with a different approach, I don't think there's any good way to do this. – Steve Vinoski Aug 31 '15 at 13:21

1 Answers1

1

Fixed here:

mochiweb commit 952087e

It was a problem with formatting the headers in the response, and not in mochiweb_headers.

eLRuLL
  • 18,488
  • 9
  • 73
  • 99