Can I force a non-200 response from these resources' js code?
We use js rest resources for accessing certain external (to Squiz) content. Consider an example page that would take ?id=123 GET, and the js rest resource will make a request to the third-party endpoint with that value (just using global keywords). The service replies with relevant content which is then displayed.
I want to be able to 404 the pages asking for missing content (or making otherwise invalid requests ?id=potato). It's trivial to get this information from the endpoint response and render "not found" text, but I want to be able to modify the http response status header of the page, which plugs into our indexing setup.