diff options
author | zachdriver <zach@driver.xyz> | 2017-02-23 11:45:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 11:45:28 -0800 |
commit | 707ff2a8425afa3018520b6b666c2645ff0d1e0c (patch) | |
tree | e3d02a7331ca1ac73ee2d83a1f0662b29f4104f8 /src/main | |
parent | e2e6e10893c5a39ba0d123d57b7652534ff2e3a4 (diff) | |
parent | 74788a689d323ee49019b3d131c953041b2b2be7 (diff) | |
download | driver-core-0.10.13.tar.gz driver-core-0.10.13.tar.bz2 driver-core-0.10.13.zip |
Merge pull request #22 from drivergroup/zsmith/auth-headerv0.10.13
Change auth header to use Authorization instead of WWW-Authenticate
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/scala/xyz/driver/core/date.scala | 1 | ||||
-rw-r--r-- | src/main/scala/xyz/driver/core/rest.scala | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/main/scala/xyz/driver/core/date.scala b/src/main/scala/xyz/driver/core/date.scala index f0b9bf6..5a6f736 100644 --- a/src/main/scala/xyz/driver/core/date.scala +++ b/src/main/scala/xyz/driver/core/date.scala @@ -18,6 +18,7 @@ object date { val AUGUST = tagMonth(Calendar.AUGUST) val SEPTEMBER = tagMonth(Calendar.SEPTEMBER) val OCTOBER = tagMonth(Calendar.OCTOBER) + val NOVEMBER = tagMonth(Calendar.NOVEMBER) val DECEMBER = tagMonth(Calendar.DECEMBER) } diff --git a/src/main/scala/xyz/driver/core/rest.scala b/src/main/scala/xyz/driver/core/rest.scala index da6df96..ecc3027 100644 --- a/src/main/scala/xyz/driver/core/rest.scala +++ b/src/main/scala/xyz/driver/core/rest.scala @@ -33,8 +33,9 @@ object rest { } object ContextHeaders { - val AuthenticationTokenHeader = "WWW-Authenticate" - val TrackingIdHeader = "X-Trace" + val AuthenticationTokenHeader = "Authorization" + val AuthenticationHeaderPrefix = "Bearer" + val TrackingIdHeader = "X-Trace" object LinkerD { // https://linkerd.io/doc/0.7.4/linkerd/protocol-http/ @@ -61,7 +62,11 @@ object rest { h.name === ContextHeaders.AuthenticationTokenHeader || h.name === ContextHeaders.TrackingIdHeader // || ContextHeaders.LinkerD.isLinkerD(h.lowercaseName) } map { header => - header.name -> header.value + if (header.name === ContextHeaders.AuthenticationTokenHeader) { + header.name -> header.value.stripPrefix(ContextHeaders.AuthenticationHeaderPrefix).trim + } else { + header.name -> header.value + } } toMap } |