Re: Returning 200 status from my handler

Marius Gavrilescu <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
John Dunlap <[email protected]> writes:

> Am I missing something?

Quoting [0]:

    HTTP handlers may return any HTTP status, which similarly to
    Apache2::Const::DONE will cause an abort of the request cycle, by
    also will be interpreted as an error. Therefore you don't want to
    return Apache2::Const::HTTP_OK from your HTTP response handler, but
    Apache2::Const::OK and Apache will send the 200 OK status by
    itself.

Apache2::Const::OK tells apache2 that the handler was successful.

Apache2::Const::HTTP_* tell apache2 that the handler failed and the
error code should be HTTP_*.

Thus, returning Apache2::Const::HTTP_OK would tell apache2 that
something went wrong and it should send an error, and the error should
have return code 200 OK.

[0]: https://perl.apache.org/docs/2.0/user/handlers/intro.html#Handler_Return_Values
-- 
Marius Gavrilescu
signature.asc (application/pgp-signature, 818 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJS0P4BAAoJEMoENb5ewbNiaKgP/37ishbFh90yxpT8K5dteeTq
+BvvEyCfcDE2vf8bxS5xiuQ1D9pzXb0IuVFLxHR2B9dGtwpr/lr8HRA/uPcx93ds
tQ6Pd1IijcD2Uf5NbQw8xPnqFhT1a9yUC8pcBKQdYjCsI2xuOdhwN7bW11sJnx3J
dbE8dMLIZPRAOBK5KYOk6NLQQszDy8sSdcR0lsGZU87baAUfw3BdgncKzF21dneW
5yZaCn9XPMWx1XPM8iOr6vETJsp+fgLTRUD4UAqOggC0N/7bSy1hYhwayuG4Zei5
6LXc8NCTTpQDa3EfzgtpM7ODXcgz42uRHxrD574EINSkCVk5FDclbj8ViArKqsol
8dlu/uAq3nrUshdLC6YiqBHSbNB23kcloJoGQyzk42uG7pyCh7KkEhoHJ8+hP780
NHWDL+3mKiR1YR7754XlRf/wLIB52IWCabbNHaAFmgcXFjQTcNeMKtn42NMsrOlX
a90VaNED+uTktWkCjBwtp7tgx66O3EQHXfOWaiulcv9au1ix0oqejrAA7RSDRHf9
ZfqFgYyKwyMW95RhiWYejDBM3iQxKY3kS+uSOIAEDjNWhMWJsBEq/1PpJmaA+A+U
6hymfiAhOAOfv9TdPT6WCI/+srWX3GV7KKjVDno5nNsmJ7cqu68MEiQKenr61qL3
rDDq0LwXm14oTQ9iObNx
=FRhs
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.