Fork me on GitHub
#liberator
<
2017-04-25
>
actsasgeek14:04:40

Without debating the relative merits or wisdom of doing so, am I supposed to be able to override the handler for a particular resource for :handle-not-implemented? I seem to be unable to do so but I’m still not used to our codebase and I want to verify that I can before I try to figure out why I cannot.

actsasgeek14:04:40

I think the “rub” as it were is that I really don’t want to return a 501 for this particular logical path but a 404 and well, someone or something disagrees with me.

ordnungswidrig14:04:56

You can override handlers which is at the gist of liberator’s model.

actsasgeek14:04:13

ok, I’ll have to dig deeper. I have a handler set for :handle-not-implemented that sets the status and message to 404 and “Not Found” but it seems to get set right back to 501 and “Not Supported” in the end.

ordnungswidrig14:04:39

Are you sure you want to use :handle-not-implemented? Anyways it works if called like this: ((resource :allowed-methods [:put] :exists? false :can-put-to-missing? false :handle-not-implemented “Buuuh”) {:request-method :put})

ordnungswidrig14:04:30

…or ((resource :allowed-methods [:put] :exists? false :can-put-to-missing? false :handle-not-implemented (ring-response "Buuuh" {:status 404})) {:request-method :put}) if you want to force the status code.

actsasgeek15:04:43

Hmm. I think I’m doing that and it’s still not cooperating. Let me make a minimal test case so I can figure out what’s going on. Thanks.