playframework-2.6

Play 2.6, URI length exceeds the configured limit of 2048 characters


I am trying to migrate a Play 2.5 version to 2.6.2. I keep getting the URI-length exceeds error. Anyone knows how to override this?

I tried below Akka setting but still no luck.

play.server.akka{
http.server.parsing.max-uri-length = infinite
http.client.parsing.max-uri-length = infinite      
http.host-connection-pool.client.parsing.max-uri-length = infinite      
http.max-uri-length = infinite
max-uri-length = infinite
}

Solution

  • Simply add

    akka.http {
      parsing {
        max-uri-length = 16k
      }
    }
    

    to your application.conf. The prefix play.server is only used for a small subset of convenience features for Akka-HTTP integration into the Playframework, e.g. play.server.akka.requestTimeout. Those are documented in the Configuring the Akka HTTP server backend documentation.