[svn-commits] mjordan: testsuite/asterisk/trunk r5237 - /asterisk/trunk/tests/rest_api/CORS/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Jul 12 15:05:17 CDT 2014


Author: mjordan
Date: Sat Jul 12 15:05:11 2014
New Revision: 5237

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5237
Log:
rest_api/CORS: fix exception caused by improper referencing of non-existant key

When attempting to see if a header existed in a dictionary, the CORS test used
a direct access via the dictionary key index. In terms of determining whether
or not the header is present, that's not very effective.

Modified:
    asterisk/trunk/tests/rest_api/CORS/run-test

Modified: asterisk/trunk/tests/rest_api/CORS/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/CORS/run-test?view=diff&rev=5237&r1=5236&r2=5237
==============================================================================
--- asterisk/trunk/tests/rest_api/CORS/run-test (original)
+++ asterisk/trunk/tests/rest_api/CORS/run-test Sat Jul 12 15:05:11 2014
@@ -48,7 +48,7 @@
             test.passed = False
             test.stop_reactor()
 
-        if resp.headers['Access-Control-Allow-Origin'] is None:
+        if resp.headers.get('Access-Control-Allow-Origin') is None:
             if expect_headers == True:
                 LOGGER.error("Expected Access-Control-Allow-Origin header.")
                 test.passed = False




More information about the svn-commits mailing list