sugar-framework / sugar

Modular web framework for Elixir
https://sugar-framework.github.io/
MIT License
430 stars 29 forks source link

Stacktrace with Plug.Conn.InvalidHeaderKeyFormatError #81

Closed ghost closed 8 years ago

ghost commented 8 years ago

After a malformed POST request (not expected by the Router):

12:42:34.044 [error] #PID<0.302.0> running Queerlink.Router terminated
Server: localhost:4000 (http)
Request: POST /shorten/json
** (exit) an exception was raised:
    ** (Plug.Conn.InvalidHeaderKeyFormatError) header key is not lowercase: Location
        (plug) lib/plug/conn.ex:900: Plug.Conn.validate_header_key!/1
        (plug) lib/plug/conn.ex:527: Plug.Conn.put_resp_header/3
        (plugs) lib/sugar/plugs/hot_code_reload.ex:13: Sugar.Plugs.HotCodeReload.call/2
        (queerlink) lib/queerlink/router.ex:1: Queerlink.Router.do_call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
ghost commented 8 years ago

I still see this error from time to time, especially on Queerlink.

YellowApple commented 8 years ago

Should be fixed now as of the latest version of HotCodeReload.