secure_headers icon indicating copy to clipboard operation
secure_headers copied to clipboard

Compilation Error

Open xanderdunn opened this issue 6 years ago • 2 comments

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"

xanderdunn avatar Sep 27 '17 21:09 xanderdunn

same here

prem-prakash avatar Feb 07 '18 13:02 prem-prakash

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.

happysalada avatar Feb 18 '18 05:02 happysalada