climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1572823 - in /incubator/climate/trunk/ocw-ui/backend: directory_helpers.py local_file_metadata_extractors.py processing.py rcmed_helpers.py run_webservices.py
Date Fri, 28 Feb 2014 05:46:51 GMT
Author: joyce
Date: Fri Feb 28 05:46:51 2014
New Revision: 1572823

URL: http://svn.apache.org/r1572823
Log:
CLIMATE-350 - Actually fix the bad response header bug this time

Modified:
    incubator/climate/trunk/ocw-ui/backend/directory_helpers.py
    incubator/climate/trunk/ocw-ui/backend/local_file_metadata_extractors.py
    incubator/climate/trunk/ocw-ui/backend/processing.py
    incubator/climate/trunk/ocw-ui/backend/rcmed_helpers.py
    incubator/climate/trunk/ocw-ui/backend/run_webservices.py

Modified: incubator/climate/trunk/ocw-ui/backend/directory_helpers.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/directory_helpers.py?rev=1572823&r1=1572822&r2=1572823&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/directory_helpers.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/directory_helpers.py Fri Feb 28 05:46:51 2014
@@ -17,7 +17,7 @@
 
 ''' Endpoints for retrieving directory information from the server. '''
 
-from bottle import Bottle, request
+from bottle import Bottle, request, response
 import os
 import re
 
@@ -200,6 +200,11 @@ def get_path_leader():
         return "%s(%s)" % (request.query.callback, return_json)
     return return_json
 
+@dir_app.hook('after_request')
+def enable_cors():
+    ''' Allow Cross-Origin Resource Sharing for all URLs. '''
+    response.headers['Access-Control-Allow-Origin'] = '*'
+
 def _get_clean_directory_path(path_leader, dir_path):
     ''' Return a cleaned directory path with a defined path prefix.
 

Modified: incubator/climate/trunk/ocw-ui/backend/local_file_metadata_extractors.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/local_file_metadata_extractors.py?rev=1572823&r1=1572822&r2=1572823&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/local_file_metadata_extractors.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/local_file_metadata_extractors.py Fri Feb 28 05:46:51
2014
@@ -20,7 +20,7 @@
 import sys
 import netCDF4
 
-from bottle import Bottle, request, route
+from bottle import Bottle, request, route, response
 
 import ocw.utils
 
@@ -219,3 +219,8 @@ def list_vars(file_path):
         if request.query.callback:
           return "%s(%s)" % (request.query.callback, output)
         return output
+
+@lfme_app.hook('after_request')
+def enable_cors():
+    ''' Allow Cross-Origin Resource Sharing for all URLs. '''
+    response.headers['Access-Control-Allow-Origin'] = '*'

Modified: incubator/climate/trunk/ocw-ui/backend/processing.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/processing.py?rev=1572823&r1=1572822&r2=1572823&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/processing.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/processing.py Fri Feb 28 05:46:51 2014
@@ -23,7 +23,7 @@ import sys
 import os
 import math
 
-from bottle import Bottle, request
+from bottle import Bottle, request, response
 
 from config import WORK_DIR
 
@@ -39,6 +39,11 @@ import numpy as np
 
 processing_app = Bottle()
 
+@processing_app.hook('after_request')
+def enable_cors():
+    ''' Allow Cross-Origin Resource Sharing for all URLs. '''
+    response.headers['Access-Control-Allow-Origin'] = '*'
+
 @processing_app.route('/run_evaluation/', method='POST')
 def run_evaluation():
     ''' Run an OCW Evaluation.

Modified: incubator/climate/trunk/ocw-ui/backend/rcmed_helpers.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/rcmed_helpers.py?rev=1572823&r1=1572822&r2=1572823&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/rcmed_helpers.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/rcmed_helpers.py Fri Feb 28 05:46:51 2014
@@ -17,7 +17,7 @@
 
 ''' Services for interacting with NASA JPL's Regional Climate Model Evaluation Database.
'''
 
-from bottle import Bottle, request
+from bottle import Bottle, request, response
 
 import requests
 
@@ -78,3 +78,8 @@ def get_dataset_parameters():
     if (request.query.callback):
         return "%s(%s)" % (request.query.callback, r.text)
     return r.text
+
+@rcmed_app.hook('after_request')
+def enable_cors():
+    ''' Allow Cross-Origin Resource Sharing for all URLs. '''
+    response.headers['Access-Control-Allow-Origin'] = '*'

Modified: incubator/climate/trunk/ocw-ui/backend/run_webservices.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/run_webservices.py?rev=1572823&r1=1572822&r2=1572823&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/run_webservices.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/run_webservices.py Fri Feb 28 05:46:51 2014
@@ -74,6 +74,7 @@ def get_eval_result_image(file_path):
 @app.hook('after_request')
 def enable_cors():
     ''' Allow Cross-Origin Resource Sharing for all URLs. '''
+    print "setting the friggen header"
     response.headers['Access-Control-Allow-Origin'] = '*'
 
 if __name__ == "__main__":



Mime
View raw message