Skip to content

Commit 582d66d

Browse files
committed
add ip parameter
1 parent 48a1eed commit 582d66d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/scala/com/timzaak/proxy/LogWebViewer.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ class LogWebViewer(certPath: Option[String])(using system: ActorSystem) {
3636

3737
private val viewerEndpoint = endpoint.get
3838
.in("")
39+
.in(query[Option[String]]("ip"))
3940
.in(extractFromRequest(identity))
4041
.out(htmlBodyUtf8)
41-
.serverLogicSuccess { request =>
42-
val ip = extractClientIP(request)
42+
.serverLogicSuccess { (ipParam, request) =>
43+
val ip = ipParam.getOrElse(extractClientIP(request))
4344
val certDesc = certPath match {
4445
case Some(_) =>
4546
s"""<p>the server use self signed cert, you may need to register the self signed rootCA.pem to your system. </p>

0 commit comments

Comments
 (0)