2009年6月28日星期日

Re: [fw-mvc] setHttpResponseCode doesn't work ?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpHcnYACgkQadOAzz84lo9vLQCfUm3uHFAUwx7igRxQJdh74Szz
rMoAnjd27KQdC9RZb1w67tQyoLAn7nBc
=Fzqd
-----END PGP SIGNATURE-----
Matthew Weier O'Phinney <matthew@zend.com>
[Sun, 28 Jun 2009 09:18:28 -0400] :

> -- ert256 <ert256@gmail.com> wrote
> (on Sunday, 28 June 2009, 02:51 PM +0200):
> > This is my index controller :
> > <?php
> >
> > class IndexController extends Zend_Controller_Action
> > {
> > public function indexAction()
> > {
> > $this->getResponse()->setHttpResponseCode(404);
> > }
> > }
> >
> > But the request returns HTTP 200 response. How can I force it to return
> > 404 ?
> >
> > I have configured layout, and ViewRenderer automatically, and I use
> > ZendFramework 1.8.2.
>
> I've just tested this locally, and it's working fine -- I received the
> expected HTTP response code when I checked in FireBug. Perhaps you're
> behind a proxy server?
Fals alarm - mea culpa.

I haven't checked that on client side. I was looking in apache logs, and i
found a mistake. I've used %s in Log expression instead of %>s which make
huge difference.

Thanks for help.

ß
Rafał (ert16) Trójniak
m@il : ert256@gmail.com
Jid : ert256@gmail.com
GPG key-ID : 3F38968F
4711 E3BC B674 C841 BED8
0F8F 69D3 80CF 3F38 968F

没有评论: