Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add header accept-encoding for compression

  • Loading branch information...
commit e3c88c33b01dc5741aca55d9171bd48535324cc6 1 parent 9a19a25
chan mihawk authored
5 src/misultin_bridge_modules/misultin_request_bridge.erl
@@ -76,6 +76,8 @@ header(transfer_encoding, Req) ->
76 76 misultin_utility:get_key_value('Transfer-Encoding', Req:get(headers));
77 77 header(accept_language, Req) ->
78 78 misultin_utility:get_key_value('Accept-Language', Req:get(headers));
  79 +header(accept_encoding, Req) ->
  80 + misultin_utility:get_key_value('Accept-Encoding', Req:get(headers));
79 81 header(Header, Req) ->
80 82 misultin_utility:get_key_value(Header, Req:get(headers)).
81 83
@@ -84,7 +86,8 @@ headers(Req) ->
84 86 if_match, if_none_match, if_range, if_unmodified_since,
85 87 range, referer, user_agent, accept_language, accept_ranges, cookie,
86 88 keep_alive, location, content_length, content_type,
87   - content_encoding, authorization, x_forwarded_for, transfer_encoding
  89 + content_encoding, authorization, x_forwarded_for, transfer_encoding,
  90 + accept_encoding
88 91 ],
89 92 Headers2 = lists:map(fun(H) -> {H, header(H, Req)} end, Headers1),
90 93 [{K, V} || {K, V} <- Headers2, V /= undefined].
5 src/mochiweb_bridge_modules/mochiweb_request_bridge.erl
@@ -90,6 +90,8 @@ header(x_forwarded_for, Req) ->
90 90 Req:get_header_value("x-forwarded-for");
91 91 header(transfer_encoding, Req) ->
92 92 Req:get_header_value("transfer-encoding");
  93 +header(accept_encoding, Req) ->
  94 + Req:get_header_value("accept-encoding");
93 95 header(Header, Req) ->
94 96 Req:get_header_value(Header).
95 97
@@ -99,7 +101,8 @@ headers(Req) ->
99 101 if_none_match, if_unmodified_since, if_range, range,
100 102 referer, user_agent, accept_language, accept_ranges,
101 103 cookie, keep_alive, location, content_length, content_type,
102   - content_encoding, authorization, x_forwarded_for, transfer_encoding
  104 + content_encoding, authorization, x_forwarded_for, transfer_encoding,
  105 + accept_encoding
103 106 ],
104 107 Headers1 = lists:map(fun(H) -> {H, header(H, Req)} end, Headers),
105 108 [{K, V} || {K, V} <- Headers1, V /= undefined].

0 comments on commit e3c88c3

Please sign in to comment.
Something went wrong with that request. Please try again.