Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Fix headers in ko 3.2 (for png only) #18

Open
phpclub opened this issue Oct 30, 2011 · 1 comment
Open

Fix headers in ko 3.2 (for png only) #18

phpclub opened this issue Oct 30, 2011 · 1 comment

Comments

@phpclub
Copy link

phpclub commented Oct 30, 2011

/controller/captcha
public function action_index($group = 'default')
{
+ $this->response->headers('Content-Type' , 'image/png');
+ $this->response->headers('Cache-Control' , 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
+ $this->response->headers('Pragma' , 'no-cache');
+ $this->response->headers('Connection' , 'close');
Captcha::instance($group)->render(FALSE);
}

@ursoforte
Copy link

All right,
Or modify line
https://github.com/kolanos/kohana-captcha/blob/master/classes/captcha.php#L430

Request::instance()->headers['Content-Type'] = 'image/'.$this->image_type;
Request::instance()->headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0';
Request::instance()->headers['Pragma'] = 'no-cache';
Request::instance()->headers['Connection'] = 'close';

FOR

"
$request = Request::current();
$request->headers['Content-Type'] = 'image/'.$this->image_type;
$request->headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0';
$request->headers['Pragma'] = 'no-cache';
$request->headers['Connection'] = 'close';
"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants