From commits-return-5324-archive-asf-public=cust-asf.ponee.io@openwhisk.apache.org Mon Jul 23 23:18:08 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B2BAE180647 for ; Mon, 23 Jul 2018 23:18:07 +0200 (CEST) Received: (qmail 48515 invoked by uid 500); 23 Jul 2018 21:18:06 -0000 Mailing-List: contact commits-help@openwhisk.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwhisk.apache.org Delivered-To: mailing list commits@openwhisk.apache.org Received: (qmail 48506 invoked by uid 99); 23 Jul 2018 21:18:06 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2018 21:18:06 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 460A681E51; Mon, 23 Jul 2018 21:18:06 +0000 (UTC) Date: Mon, 23 Jul 2018 21:18:06 +0000 To: "commits@openwhisk.apache.org" Subject: [incubator-openwhisk] branch master updated: Make request id header name comparison case insensitive. (#3889) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <153238068581.28464.12841603967062522072@gitbox.apache.org> From: markusthoemmes@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-openwhisk X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 2db1b67ef6cc16b1f19336ed23992fae32a7d9d5 X-Git-Newrev: 5694f38d000bd2c631a9fe754422dd960bc5d88c X-Git-Rev: 5694f38d000bd2c631a9fe754422dd960bc5d88c X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. markusthoemmes pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git The following commit(s) were added to refs/heads/master by this push: new 5694f38 Make request id header name comparison case insensitive. (#3889) 5694f38 is described below commit 5694f38d000bd2c631a9fe754422dd960bc5d88c Author: tysonnorris AuthorDate: Mon Jul 23 14:18:01 2018 -0700 Make request id header name comparison case insensitive. (#3889) --- common/scala/src/main/scala/whisk/common/TransactionId.scala | 4 +++- common/scala/src/main/scala/whisk/http/BasicHttpService.scala | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/scala/src/main/scala/whisk/common/TransactionId.scala b/common/scala/src/main/scala/whisk/common/TransactionId.scala index 6441629..ae86321 100644 --- a/common/scala/src/main/scala/whisk/common/TransactionId.scala +++ b/common/scala/src/main/scala/whisk/common/TransactionId.scala @@ -245,4 +245,6 @@ object TransactionId { } } -case class TransactionGeneratorConfig(header: String) +case class TransactionGeneratorConfig(header: String) { + val lowerCaseHeader = header.toLowerCase //to cache the lowercase version of the header name +} diff --git a/common/scala/src/main/scala/whisk/http/BasicHttpService.scala b/common/scala/src/main/scala/whisk/http/BasicHttpService.scala index 586d7dc..fa4c612 100644 --- a/common/scala/src/main/scala/whisk/http/BasicHttpService.scala +++ b/common/scala/src/main/scala/whisk/http/BasicHttpService.scala @@ -108,7 +108,7 @@ trait BasicHttpService extends Directives { extract { req => val tid = req.request.headers - .find(_.name == TransactionId.generatorConfig.header) + .find(_.is(TransactionId.generatorConfig.lowerCaseHeader)) .map(_.value) .filterNot(_.startsWith(TransactionId.systemPrefix)) .getOrElse {