anotherhale / secure_headers

HTTP security headers for Phoenix/Plug
Apache License 2.0
45 stars 11 forks source link

Compilation Error #6

Open xanderdunn opened 6 years ago

xanderdunn commented 6 years ago

Elixir 1.5.1. When I attempt to compile with secure_headers 0.0.1 added to my project's dependencies, I get this error:

== Compilation error in file lib/headers/x_xss_protection.ex ==
** (ArgumentError) expected the moduledoc attribute to contain a binary, a boolean, or nil, got: 'IO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 0]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 1]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 1, mode: "block"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 1, report: "http://google.com/"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 1, mode: "block", report: "http://google.com/report"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 1, mode: "block", report: "/report/"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "0"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "0;"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "1"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "1;"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "1;mode=block"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "1; mode=block"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "1; report=http://google.com/"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "1; report=/google.com/"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "1; mode=block; report=/google.com/"])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: "1; mode=block; report=http://google.com/"])\n\n\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 0, mode: "block"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 0, report: "http://google.com/"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 0, mode: "block", report: "http://google.com/"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 0, mode: "block", report: "/report/"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 1, mode: "allow"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 1, mode: "allow", report: "http://google.com/"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 2, mode: "block"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 2, modes: "block"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 2, mode: "allow"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 2, report: "google.com"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 2, mode: "allow", report: "http://google.com/"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 2, mode: "block", report: "google.com"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [values: 2]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [value: 2, reportz: "google.com"]])\nIO.inspect( SecureHeaders.XXssProtection.validate [x_xss_protection: [valuez: 2, mode: "block", reportz: "google.com"]])\n'
    (elixir) lib/module.ex:1384: Module.preprocess_attribute/2
    (elixir) lib/module.ex:1350: Module.put_attribute/5
    lib/headers/x_xss_protection.ex:3: (module)
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
could not compile dependency :secure_headers, "mix compile" failed. You can recompile this dependency with "mix deps.compile secure_headers", update it with "mix deps.update secure_headers" or clean it with "mix deps.clean secure_headers"
prem-prakash commented 6 years ago

same here

happysalada commented 6 years ago

I tried making a PR on this repo, but on master of the repo the bug is fixed. There seems to be no releases on this package, that could be why. The best way to fix this, is to get the master of this repo as a dependency in your mix.exs file replace {:secure_headers, "~> 0.0.1"}, with {:secure_headers, github: "anotherhale/secure_headers"}, and the compilation error is fixed.