"URIs with more than 2048 characters are not supported"

1,169 views
Skip to first unread message

stephanos

unread,
Dec 9, 2011, 12:10:28 PM12/9/11
to spray-user
I just received the message "URIs with more than 2048 characters are
not supported" from a request I was making.
How do I raise/change this limit?

As far as I know this limit only applies to IEs, not other browsers.
The reason I need this is because I use <iframe> as a workaround for
cross-domain POST, that's why I need quite a bit of characters...

If this doesn't work somehow, I'd have to go back to unfiltered - but
I just fell in love with spray...


Cheers,
Stephan

Mathias

unread,
Dec 9, 2011, 4:26:09 PM12/9/11
to spray...@googlegroups.com
Stephan,

the error you are seeing is being raised in spray-cans HTTP message parser, which is fully configurable.
The ServerConfig object passed to the HttpServer has a field `parserConfig`, which has a field `maxUriLength`, which has a default value of 2048.
You can adapt it to your needs.

If you configure the spray-can HttpServer via the akka.conf file (which is the default) you can also use the 'spray-can.parser.max-uri-length' setting:

spray-can {
parser {
max-uri-length = 4096
}
}

Cheers,
Mathias

---
mat...@spray.cc
http://www.spray.cc

stephanos

unread,
Dec 10, 2011, 5:20:53 AM12/10/11
to spray-user
Fantastic. Thank you a lot!


On Dec 9, 10:26 pm, Mathias <math...@spray.cc> wrote:
> Stephan,
>
> the error you are seeing is being raised in spray-cans HTTP message parser, which is fully configurable.
> The ServerConfig object passed to the HttpServer has a field `parserConfig`, which has a field `maxUriLength`, which has a default value of 2048.
> You can adapt it to your needs.
>
> If you configure the spray-can HttpServer via the akka.conf file (which is the default) you can also use the 'spray-can.parser.max-uri-length' setting:
>
>     spray-can {
>         parser {
>             max-uri-length = 4096
>         }
>     }
>
> Cheers,
> Mathias
>
> ---

> math...@spray.cchttp://www.spray.cc

Alex Cozzi

unread,
Dec 11, 2011, 12:56:03 PM12/11/11
to spray...@googlegroups.com
Maybe the error message should be changed to: "URIs exceeds the maximum allowed length of 2048. Consider increasing maxUriLength in akka.conf"
this might help out future users

Mathias

unread,
Dec 11, 2011, 4:35:55 PM12/11/11
to spray...@googlegroups.com
Alex,

good idea, I created an issue for this:
https://github.com/spray/spray-can/issues/11

Thanks and cheers,
Mathias

---
mat...@spray.cc
http://www.spray.cc

Reply all
Reply to author
Forward
0 new messages