Bug 1282947 - Parse 'code' GET parameter as integer in cors-makeheader.py. r=jdm
authorDecky Coss <coss@cosstropolis.com>
Fri, 01 Jul 2016 17:28:12 -0400
changeset 304164 90e2eea25b34af97d380094143f8c4bd421dc223
parent 304163 5136dcccfe4a1fed96f55e1d65102adc44123a61
child 304165 83d9f275922858c133c957249bd415862f397f0b
push id30414
push usercbook@mozilla.com
push dateFri, 08 Jul 2016 09:59:01 +0000
treeherdermozilla-central@45682df2d2d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1282947
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1282947 - Parse 'code' GET parameter as integer in cors-makeheader.py. r=jdm MozReview-Commit-ID: 6rQCEWKLTYZ
testing/web-platform/meta/cors/redirect-preflight.htm.ini
testing/web-platform/tests/cors/resources/cors-makeheader.py
deleted file mode 100644
--- a/testing/web-platform/meta/cors/redirect-preflight.htm.ini
+++ /dev/null
@@ -1,17 +0,0 @@
-[redirect-preflight.htm]
-  type: testharness
-  [Disallow redirect 301 after succesful (200) preflight]
-    expected: FAIL
-
-  [Disallow redirect 302 after succesful (200) preflight]
-    expected: FAIL
-
-  [Disallow redirect 303 after succesful (200) preflight]
-    expected: FAIL
-
-  [Disallow redirect 307 after succesful (200) preflight]
-    expected: FAIL
-
-  [Disallow redirect 308 after succesful (200) preflight]
-    expected: FAIL
-
--- a/testing/web-platform/tests/cors/resources/cors-makeheader.py
+++ b/testing/web-platform/tests/cors/resources/cors-makeheader.py
@@ -23,17 +23,21 @@ def main(request, response):
     #Preflight
     if 'headers' in request.GET:
         response.headers.set("Access-Control-Allow-Headers", request.GET.first('headers'))
     if 'credentials' in request.GET:
         response.headers.set("Access-Control-Allow-Credentials", request.GET.first('credentials'))
     if 'methods' in request.GET:
         response.headers.set("Access-Control-Allow-Methods", request.GET.first('methods'))
 
-    code = request.GET.first('code', None)
+    code_raw = request.GET.first('code', None)
+    if code_raw:
+        code = int(code_raw)
+    else:
+        code = None
     if request.method == 'OPTIONS':
         #Override the response code if we're in a preflight and it's asked
         if 'preflight' in request.GET:
             code = int(request.GET.first('preflight'))
 
         #Log that the preflight actually happened if we have an ident
         if 'token' in request.GET:
             request.server.stash.put(request.GET['token'], True)
@@ -56,9 +60,8 @@ def main(request, response):
     headers['get_value'] = request.GET.first('get_value', '')
 
     body = json.dumps(headers)
 
     if code:
         return (code, "StatusText"), [], body
     else:
         return body
-