Skip to content

Commit

Permalink
Merge pull request #40 from calvinb/downcase-header-names
Browse files Browse the repository at this point in the history
Downcase header names
  • Loading branch information
handnot2 authored Jan 8, 2019
2 parents 01e52c9 + 9d482a5 commit d3dfac0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/samly/auth_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defmodule Samly.AuthHandler do
]

conn
|> put_resp_header("Content-Type", "text/html")
|> put_resp_header("content-type", "text/html")
|> send_resp(200, EEx.eval_string(@sso_init_resp_template, opts))
end

Expand Down
10 changes: 5 additions & 5 deletions lib/samly/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ defmodule Samly.Router do
conn
|> register_before_send(fn connection ->
connection
|> put_resp_header("Cache-Control", "no-cache")
|> put_resp_header("Pragma", "no-cache")
|> put_resp_header("X-Frame-Options", "SAMEORIGIN")
|> put_resp_header("X-XSS-Protection", "1; mode=block")
|> put_resp_header("X-Content-Type-Options", "nosniff")
|> put_resp_header("cache-control", "no-cache")
|> put_resp_header("pragma", "no-cache")
|> put_resp_header("x-frame-options", "SAMEORIGIN")
|> put_resp_header("x-xss-protection", "1; mode=block")
|> put_resp_header("x-content-type-options", "nosniff")
end)
end
end
4 changes: 2 additions & 2 deletions lib/samly/router_util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ defmodule Samly.RouterUtil do
resp_body = :esaml_binding.encode_http_post(idp_url, signed_xml_payload, relay_state)

conn
|> Conn.put_resp_header("Content-Type", "text/html")
|> Conn.put_resp_header("content-type", "text/html")
|> Conn.send_resp(200, resp_body)
end
end

def redirect(conn, status_code, dest) do
conn
|> Conn.put_resp_header("Location", dest)
|> Conn.put_resp_header("location", dest)
|> Conn.send_resp(status_code, "")
|> Conn.halt()
end
Expand Down
2 changes: 1 addition & 1 deletion lib/samly/sp_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Samly.SPHandler do
metadata = Helper.sp_metadata(sp)

conn
|> put_resp_header("Content-Type", "text/xml")
|> put_resp_header("content-type", "text/xml")
|> send_resp(200, metadata)

# rescue
Expand Down

0 comments on commit d3dfac0

Please sign in to comment.