How to set akka.http server settings?

932 views
Skip to first unread message

Leo Haskin

unread,
Jul 24, 2017, 11:48:31 AM7/24/17
to Play Framework
I am trying to change the max-uri-length setting (http://doc.akka.io/docs/akka-http/10.0.7/scala/http/configuration.html), I tried adding the following setting to the run command:

-Dakka.http.server.parsing.max-uri-length=3k 

-Dplay.server.akka.http.server.parsing.max-uri-length=3k

-Dplay.server.parsing.max-uri-length=3k


I keep getting the same error when passing a URL longer than 2048:

[akka.actor.ActorSystemImpl(play-dev-mode)] Illegal request, responding with status '414 Request-URI Too Long': URI length exceeds the configured limit of 2048 characters



Is there any way to change this setting in the akka http server?

Thank you!
Leo

Leszek

unread,
Jul 25, 2017, 5:58:43 AM7/25/17
to Play Framework
Please check here: https://www.playframework.com/documentation/2.6.x/SettingsAkkaHttp
Altough, I don't see any URI related settings.

Leo Haskin

unread,
Jul 25, 2017, 8:28:47 AM7/25/17
to Play Framework
I did read that section, and as I said, I tried to set the setting in those three ways:


-Dakka.http.server.parsing.max-uri-length=3k 

-Dplay.server.akka.http.server.parsing.max-uri-length=3k

-Dplay.server.parsing.max-uri-length=3k


but neither worked.



Justin du coeur

unread,
Jul 25, 2017, 12:24:53 PM7/25/17
to play-fr...@googlegroups.com
I don't know how the internals of Akka-HTTP work, but keep in mind that 3k URLs are pretty strongly discouraged in general.  As a rule of thumb, browsers start to crap out when a URL goes above roughly 2k, and that is often treated as a de facto maximum URL length in many systems.  It wouldn't astonish me if that (deliberately or accidentally) got baked into Akka-HTTP somewhere...

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/ef9665ce-5183-444a-bffe-ea157ba98d53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leo Haskin

unread,
Nov 21, 2017, 11:40:35 AM11/21/17
to Play Framework
FYI for others that may stumble on this, the solution was:

-Dakka.http.parsing.max-uri-length=16k



Furthermore, I found that this setting does not work if added to application.conf, at least not when running in development mode.  It must be used on command line.
Reply all
Reply to author
Forward
0 new messages