Illegal Header Warnings From Akka HTTP Server

We are currently using Play Framework 2.6.15 version with Akka as our http server. Our logs are clogged with illegal header warnings similar to this:

ActorSystemImpl.$anonfun$applyOrElse$2:77 Illegal header: Illegal ‘user-agent’ header: Invalid input ‘/’, expected OWS, ‘EOI’, tchar, product-or-comment or comment (line 1, column 132): Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16B92 QuantcastSDK/iOS_1.4.2/0nq5uo7apf52qbz4-wg10xs56f0s56tmf

We tried disabling the illegal header warnings using the following settings in the application conf:

play {
  server {
    # The server provider class name
    provider = "play.core.server.AkkaHttpServerProvider"
    akka {
      bindTimeout = 5 seconds
      transparent-head-requests = off
      default-host-header = ""
      max-content-length = infinite
      tls-session-info-header = on
      http {
        parsing {
          max-uri-length = 100k
          illegal-header-warnings = off
        }
      }
    }
  }
}

The warnings still persist. Is there something wrong with the conf file?

Might be a little late - you have misconfigured it slightly https://stackoverflow.com/a/36842582/28298

I’m not sure in which version of 2.6.x we improved this, but try to use the latest version (2.6.23 at the moment). See this issue for a discussion about it:

Best.