markusthoemmes commented on a change in pull request #3889: make request id
header name comparison case insensitive
URL:
https://github.com/apache/incubator-openwhisk/pull/3889#discussion_r204242979
##########
File path: 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(_.name.toLowerCase ==
TransactionId.generatorConfig.header.toLowerCase)
Review comment:
Great catch! akka-http normalizes everything to lowercase, so you can use:
```scala
.find(_.is(TransactionId.generatorConfig.header.toLowerCase))
```
We should also cache the lowercased value of the configured header
somewhere, needs to be computed only once.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services