cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1521200 - /cxf/branches/2.6.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptQueryHandler.java
Date Mon, 09 Sep 2013 17:23:18 GMT
Author: dkulp
Date: Mon Sep  9 17:23:18 2013
New Revision: 1521200

URL: http://svn.apache.org/r1521200
Log:
Merged revisions 1521177 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1521177 | dkulp | 2013-09-09 12:23:22 -0400 (Mon, 09 Sep 2013) | 10 lines

  Merged revisions 1521175 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1521175 | dkulp | 2013-09-09 12:16:41 -0400 (Mon, 09 Sep 2013) | 2 lines

    Guard against an invalid URI

  ........

........

Modified:
    cxf/branches/2.6.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptQueryHandler.java

Modified: cxf/branches/2.6.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptQueryHandler.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptQueryHandler.java?rev=1521200&r1=1521199&r2=1521200&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptQueryHandler.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptQueryHandler.java
Mon Sep  9 17:23:18 2013
@@ -70,10 +70,14 @@ public class JavascriptQueryHandler impl
     }
     
     public String getResponseContentType(String fullQueryString, String ctx) {
-        URI uri = URI.create(fullQueryString);
-        Map<String, String> map = UrlUtils.parseQueryString(uri.getQuery());
-        if (map.containsKey(CODE_QUERY_KEY)) {
-            return "application/javascript;charset=UTF-8";
+        try {
+            URI uri = URI.create(fullQueryString);
+            Map<String, String> map = UrlUtils.parseQueryString(uri.getQuery());
+            if (map.containsKey(CODE_QUERY_KEY)) {
+                return "application/javascript;charset=UTF-8";
+            }
+        } catch (IllegalArgumentException iae) {
+            //invalid URI string, ignore and continue
         }
         return null;
     }
@@ -83,10 +87,14 @@ public class JavascriptQueryHandler impl
         if (baseUri == null) {
             return false;
         }
-        URI uri = URI.create(baseUri);
-        Map<String, String> map = UrlUtils.parseQueryString(uri.getQuery());
-        if (map.containsKey(CODE_QUERY_KEY)) {
-            return endpointInfo.getAddress().contains(UrlUtils.getStem(uri.getSchemeSpecificPart()));
+        try {
+            URI uri = URI.create(baseUri);
+            Map<String, String> map = UrlUtils.parseQueryString(uri.getQuery());
+            if (map.containsKey(CODE_QUERY_KEY)) {
+                return endpointInfo.getAddress().contains(UrlUtils.getStem(uri.getSchemeSpecificPart()));
+            }
+        } catch (IllegalArgumentException iae) {
+            //invalid URI string, ignore and continue
         }
         return false;
     }



Mime
View raw message