Name
is_http_ctx, is_https_ctx, is_http_error_handler — tests for the kind of HTTP request context the current procedure is running in
Synopsis
integer is_http_ctx(
|
); |
integer is_https_ctx(
|
); |
integer is_http_error_handler(
|
); |
Description
is_http_ctx returns 1 when the current procedure is
being executed in response to an HTTP request (whether over plain HTTP or
TLS), 0 otherwise. Use it inside utility procedures that should behave
differently when invoked from a Web request vs. an SQL prompt or a
scheduler job.
is_https_ctx returns 1 when the current request
arrived over TLS, 0 otherwise. Combine with
is_http_ctx to detect plain HTTP vs HTTPS.
is_http_error_handler returns 1 when the current
procedure was invoked as the HTTP error handler (registered via the
vhost error-handler binding) rather than as the normal
request handler. Use this to differentiate the failure-recovery path from
the success path.