Title: [100865] trunk/Tools
Revision
100865
Author
o...@chromium.org
Date
2011-11-19 18:09:19 -0800 (Sat, 19 Nov 2011)

Log Message

Fix jsonp callback code to add the callback if json content
is not jsonp.
* TestResultServer/handlers/testfilehandler.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (100864 => 100865)


--- trunk/Tools/ChangeLog	2011-11-20 01:52:06 UTC (rev 100864)
+++ trunk/Tools/ChangeLog	2011-11-20 02:09:19 UTC (rev 100865)
@@ -1,3 +1,9 @@
+2011-11-19  Ojan Vafai  <o...@chromium.org>
+
+        Fix jsonp callback code to add the callback if json content
+        is not jsonp.
+        * TestResultServer/handlers/testfilehandler.py:
+
 2011-11-19  Alice Boxhall  <aboxh...@chromium.org>
 
         Modify dashboard_base.js to optionally accept version 4 results json.

Modified: trunk/Tools/TestResultServer/handlers/testfilehandler.py (100864 => 100865)


--- trunk/Tools/TestResultServer/handlers/testfilehandler.py	2011-11-20 01:52:06 UTC (rev 100864)
+++ trunk/Tools/TestResultServer/handlers/testfilehandler.py	2011-11-20 02:09:19 UTC (rev 100865)
@@ -52,7 +52,10 @@
 
 def _replace_jsonp_callback(json, callback_name):
     if callback_name and re.search(r"^[A-Za-z0-9_]+$", callback_name):
-        json = re.sub(r"^[A-Za-z0-9_]+[(]", callback_name + "(", json)
+        if re.search(r"^[A-Za-z0-9_]+[(]", json):
+            return re.sub(r"^[A-Za-z0-9_]+[(]", callback_name + "(", json)
+        return callback_name + "(" + json + ")"
+
     return json
 
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to