Fork me on GitHub
#yada
<
2017-09-18
>
borkdude10:09:42

When I have resource like {:methods {:post {:response (fn [ctx] nil)}}} should it result in a 404?

dominicm10:09:30

I think returning nil from a response means 404, so yes.

malcolmsparks11:09:33

Yes. Nil means 404

malcolmsparks12:09:02

Because your response fn is returning nil

malcolmsparks12:09:12

For example. Your route may match but a parameter in the path (e.g. accno) points to a resource (e.g. bank account) that doesn't exist

stijn12:09:32

I believe @borkdude is saying that it does return a 200

stijn12:09:56

that is because it's a POST

malcolmsparks12:09:08

Sorry I misread the problem

malcolmsparks12:09:43

The semantics for post are different.

malcolmsparks12:09:56

You may be adding a message to a queue, inserting a database record, anything. The default response status should be 200 OK (I believe)

borkdude12:09:41

ok, good to know

frozenlock20:09:46

Is there a way to enable it?

danielcompton21:09:11

@frozenlock I think that's just for accepting Gzip'd requests

frozenlock21:09:00

@danielcompton Thanks, I'll give it a try!

frozenlock21:09:40

@danielcompton It worked! Thanks 🙂

danielcompton21:09:02

No problem. I have a feeling that it will compress everything, including images if you're serving them from that server

frozenlock21:09:13

Is this a problem for caching?

danielcompton21:09:38

not really, but it's unnecessary as images are already pretty compressed

danielcompton21:09:54

if you're caching your static assets with a CDN in front then it probably doesn't matter