Fork me on GitHub
#ring
<
2017-06-06
>
kah0ona14:06:59

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?

weavejester15:06:18

@kah0ona Ring doesn’t add any itself, but Ring-Defaults does. Are you using that middleware?

kah0ona15:06:39

aah thanks

kah0ona15:06:50

Do you know which specific middleware adds Content-Security-Headers?

kah0ona15:06:51

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..

weavejester15:06:20

@kah0ona Oh, you mean like Content-Security-Policy?

weavejester15:06:34

So you’re not talking about security headers in general?

kah0ona15:06:06

i just realized the problem

kah0ona15:06:08

it’s in pedestal

kah0ona15:06:14

well; since our pedestal upgrade

weavejester15:06:19

X-Content-Security-Policy is the old name for the header. That should probably be updated.

kah0ona15:06:20

they also add middleware

kah0ona15:06:44

sorry for the inconvenience 🙂 I can fix this problem now

weavejester15:06:01

No problem 🙂 - it can be hard to find which middleware adds which headers.

weavejester15:06:08

Or interceptor, in Pedestal’s case.

kah0ona15:06:12

yeah indeed

kah0ona15:06:30

we use both pedestal and ring in this codebase, i mixed it up. end of the day here… not too sharp 🙂

JAtkins16:06:33

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)

weavejester17:06:34

@jatkin Middleware takes in a handler as an argument, and returns a handler.

petr.mensik20:06:14

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 😕

seancorfield20:06:40

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?

petr.mensik20:06:52

Yeah, I tried that before and nothing seems to collide with ring or ring/ring-core

petr.mensik20:06:43

Actually it does, weird is that lein deps :tree | less is actually not giving suggestions by lein

petr.mensik20:06:51

that's why I didn't see it

petr.mensik21:06:30

Ok, even so, I don't really see any offending deps there https://pastebin.com/tPe6qXBH

seancorfield21:06:27

[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"]

seancorfield21:06:39

That’s bringing in an old version of Ring.

seancorfield21:06:59

You might also want to check which version of lein-ring you’re using.

petr.mensik22:06:03

I'll look at it, thank you