-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow forwarding of proxy headers to ES
- Loading branch information
1 parent
fd046ee
commit 4342348
Showing
5 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
package models | ||
|
||
case class ElasticServer(host: String, authentication: Option[ESAuth] = None) | ||
import play.api.mvc.Headers | ||
|
||
case class ElasticServer(host: String, authentication: Option[ESAuth] = None, forwardHeadersNames: Seq[String] = Seq.empty) { | ||
|
||
protected var _headers: Seq[(String, String)] = Seq() | ||
|
||
def setForwardHeader(headers : Headers) { | ||
for (e <- forwardHeadersNames) { | ||
if (headers.hasHeader(e)) { | ||
_headers = _headers :+ (e, headers.get(e).orNull) | ||
} | ||
} | ||
} | ||
|
||
def forwardHeaders(): Seq[(String, String)] = _headers | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters