From 46e680613f20ec4bbe4e34bcf4dae820cebfcf99 Mon Sep 17 00:00:00 2001 From: Alexander Metrocavich Date: Mon, 27 Jun 2016 12:01:31 -0400 Subject: [PATCH] Add OAuth Header fix Old OAuth would not keep any previous headers --- src/main/scala/core/OAuth.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/core/OAuth.scala b/src/main/scala/core/OAuth.scala index 16a5211..bed1abb 100644 --- a/src/main/scala/core/OAuth.scala +++ b/src/main/scala/core/OAuth.scala @@ -59,7 +59,8 @@ object OAuth { val oauth = TreeMap[String, String]() ++ (oauthParams + ("oauth_signature" -> percentEncode(sig))) map { case (k, v) => "%s=\"%s\"" format (k, v) } mkString ", " // return the signed request - httpRequest.withHeaders(List(RawHeader("Authorization", "OAuth " + oauth))).withEntity(newEntity) + val newHeaders = httpRequest.headers.filterNot(_.is("authorization")) :+ RawHeader("Authorization", "OAuth " + oauth) + httpRequest.withHeaders(newHeaders)).withEntity(newEntity) } }