Make CORS great again
This fixes CORS to work properly with most 2.5 api endpoints while keeping the JSONP format available. * [x] return JSONP or JSON with proper CORS headers from API * [x] Field in Genereal Preferences Form to configure CORS enabled URLs See #17 for what triggered this refactor. I beleive this should make integrating the APIs on the client side trivial without mandating the use of JSONP.
This commit is contained in:
parent
e3785e25f9
commit
baa0f9ba77
7 changed files with 66 additions and 48 deletions
|
@ -1645,4 +1645,23 @@ class Application_Model_Preference
|
|||
public static function setBandwidthLimitUpdateTimer() {
|
||||
self::setValue("bandwidth_limit_update_timer", microtime(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for CORS URLs
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function GetAllowedCorsUrls() {
|
||||
return self::getValue('allowed_cors_urls');
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for CORS URLs
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public static function SetAllowedCorsUrls($value) {
|
||||
self::setValue('allowed_cors_urls', $value);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue