Hi all,

In mod_include, we currently only allow 200 OK responses to be included within the document. If any other code is returned, we replace the document body with a hard coded error string. This places a significant limitation on the usefulness of mod_include.

Ideally, the included URL should be empowered to handle errors itself, as you'd expect of any restful URL. In other words, an included URL might want to return 404 Not Found, with a body suitable for inclusion in the main template, possibly taking advantage of content negotiation, and if so, it should be allowed to do so.

What I have in mind is a syntax like this:

<!--#include response="200,404,500-599" virtual="/my/included/url"-->

This would mean that if the response code is in the range shown, include the URL, otherwise revert to the hard coded error string.

Other templating systems have tried to offer "URL to show on error" functionality, which I believe is overkill. HTTP already contains an error handling mechanism, and httpd supports ErrorDocument where the application doesn't handle errors of its own, mod_include should honour this existing mechanism, and not invent it's own.

Regards,
Graham
--

Reply via email to