From 68149dd88a35f904b3defed3bd5fc617ce83a120 Mon Sep 17 00:00:00 2001 From: Vamshi Maskuri <117595548+varshith257@users.noreply.github.com> Date: Sat, 28 Sep 2024 13:00:07 +0530 Subject: [PATCH] fmt --- zio-http/shared/src/main/scala/zio/http/Routes.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zio-http/shared/src/main/scala/zio/http/Routes.scala b/zio-http/shared/src/main/scala/zio/http/Routes.scala index 277d5d6c67..d2383585aa 100644 --- a/zio-http/shared/src/main/scala/zio/http/Routes.scala +++ b/zio-http/shared/src/main/scala/zio/http/Routes.scala @@ -300,9 +300,16 @@ final case class Routes[-Env, +Err](routes: Chunk[zio.http.Route[Env, Err]]) { s private def validateHeaders(req: Request): Handler[Any, Response, Request, Response] = { val invalidHeaderChars = Set('\r', '\n', '\u0000') + ZIO.logInfo(s"Validating headers for request: ${req.headers}") + // Check if any header contains invalid characters val hasInvalidChar = req.headers.toList.exists { header => - header.renderedValue.exists(invalidHeaderChars.contains) + // header.renderedValue.exists(invalidHeaderChars.contains) + val hasInvalid = header.renderedValue.exists(invalidHeaderChars.contains) + if (hasInvalid) { + ZIO.logInfo(s"Invalid header found: ${header.name} -> ${header.renderedValue}") + } + hasInvalid } if (hasInvalidChar) {