liberator

actsasgeek 2017-04-25T14:12:40.885669Z

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.

actsasgeek 2017-04-25T14:13:40.913679Z

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.

ordnungswidrig 2017-04-25T14:44:56.808275Z

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

actsasgeek 2017-04-25T14:46:13.846663Z

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.

ordnungswidrig 2017-04-25T14:50:39.979468Z

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})

ordnungswidrig 2017-04-25T14:51:30.005561Z

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

actsasgeek 2017-04-25T15:05:43.437835Z

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.