This is an automated email from the ASF dual-hosted git repository.

tysonnorris pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new af16122  Add defensive code to the controller for when it gets bad 
query parameters (#4952)
af16122 is described below

commit af161221244399e801b0217af554abd00e96c2b2
Author: dan mcweeney <[email protected]>
AuthorDate: Wed Sep 23 13:01:39 2020 -0400

    Add defensive code to the controller for when it gets bad query parameters 
(#4952)
    
    * Add defensive code to the controller for when it gets bad query parameters
---
 .../scala/org/apache/openwhisk/http/BasicHttpService.scala     | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/common/scala/src/main/scala/org/apache/openwhisk/http/BasicHttpService.scala 
b/common/scala/src/main/scala/org/apache/openwhisk/http/BasicHttpService.scala
index 27f1be9..a168df7 100644
--- 
a/common/scala/src/main/scala/org/apache/openwhisk/http/BasicHttpService.scala
+++ 
b/common/scala/src/main/scala/org/apache/openwhisk/http/BasicHttpService.scala
@@ -120,7 +120,15 @@ trait BasicHttpService extends Directives {
   protected def logRequestInfo(req: HttpRequest)(implicit tid: TransactionId): 
LogEntry = {
     val m = req.method.name
     val p = req.uri.path.toString
-    val q = req.uri.query().toString
+
+    val q: String = {
+      try {
+        req.uri.query().toString
+      } catch {
+        case _: IllegalUriException => s"Bad query 
parameters:${req.uri.toString()}"
+        case e: Exception           => s"Query parsing error: ${e.getMessage}"
+      }
+    }
     val l = loglevelForRoute(p)
     LogEntry(s"[$tid] $m $p $q", l)
   }

Reply via email to