Hello guys, I have a problem with Content-Security-Headers being returned and preventing my .js files to be loaded. Where/how can I configure those? Is this something a recent version of Ring is doing, or is it in ring-headers?
@kah0ona Ring doesn’t add any itself, but Ring-Defaults does. Are you using that middleware?
aah thanks
Do you know which specific middleware adds Content-Security-Headers?
hm it seems to be ring.middleware.x-headers, but that only adds X-Content-Secuirty-Policy headers, rather than the one without X- prefix..
@kah0ona Oh, you mean like Content-Security-Policy
?
So you’re not talking about security headers in general?
aah
i just realized the problem
it’s in pedestal
well; since our pedestal upgrade
X-Content-Security-Policy
is the old name for the header. That should probably be updated.
they also add middleware
sorry for the inconvenience 🙂 I can fix this problem now
No problem 🙂 - it can be hard to find which middleware adds which headers.
Or interceptor, in Pedestal’s case.
yeah indeed
we use both pedestal and ring in this codebase, i mixed it up. end of the day here… not too sharp 🙂
How do I use middleware? I want to use ring-partial-content, but I'm not sure how to use it. (I'm working on my first ring/clojure/web project, so I don't know much about servers)
@jatkin Middleware takes in a handler as an argument, and returns a handler.
There’s more about it here: https://github.com/ring-clojure/ring/wiki/Concepts#middleware
Hello guys, I am currently facing strange problem that I can build my project with lein repl
or lein ring server
, however when I try lein ring uberwar
I get
Can't import ring.util.response/find-header, try updating to Ring 1.6.0+
Above problem is caused by https://github.com/metosin/ring-http-response/ library. It almost seems like ring-http-response
is being added as dev dependency but I really don't know why 😕Sounds like something is pulling in an older version of Ring as a (transitive) dependency. Try lein deps :tree
to see if you can identify where the older Ring is coming from?
Yeah, I tried that before and nothing seems to collide with ring
or ring/ring-core
Actually it does, weird is that lein deps :tree | less
is actually not giving suggestions by lein
that's why I didn't see it
Ok, even so, I don't really see any offending deps there https://pastebin.com/tPe6qXBH
[lib-noir "0.9.3"] -> [ring-middleware-format "0.4.0"] -> [ring "1.3.0"] -> [ring/ring-devel "1.3.0"] -> [hiccup "1.0.5"]
That’s bringing in an old version of Ring.
You might also want to check which version of lein-ring
you’re using.
I'll look at it, thank you