Re: CORS Request Handling

2012-09-20 Thread lowpass
Looks like a job for CakeResponse.

http://mark-story.com/posts/view/cakeresponse-in-cakephp-2-0
http://book.cakephp.org/2.0/en/controllers/request-response.html

On Wed, Sep 19, 2012 at 6:07 PM, Robert crsh...@gmail.com wrote:
 Hello All,

 I'm in the process of getting CORS (Cross-Origin Resource Sharing) for my
 API which is done using CakePHP (duh!) and I wanted to know if anyone had
 any insight as to where the best place was to put the CORS header responses.

 I currently have a really hacked up bunch of code at the top of my
 bootstrap.php file, which is probably not where it's supposed to be.

 I'm thinking the CORS handling should be broken out into a component similar
 to the Security component.

 Thoughts?

 More information regarding CORS can be found here:
 https://developer.mozilla.org/en-US/docs/HTTP_access_control

 --
 Like Us on FacekBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.



-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




CORS Request Handling

2012-09-19 Thread Robert
Hello All,

I'm in the process of getting CORS (Cross-Origin Resource Sharing) for my 
API which is done using CakePHP (duh!) and I wanted to know if anyone had 
any insight as to where the best place was to put the CORS header responses.

I currently have a really hacked up bunch of code at the top of my 
bootstrap.php file, which is probably *not* where it's supposed to be.

I'm thinking the CORS handling should be broken out into a component 
similar to the Security component.

Thoughts?

More information regarding CORS can be found here: 
https://developer.mozilla.org/en-US/docs/HTTP_access_control

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.