Wiremock - 413 REQUEST ENTITY TOO LARGE when passing a very long token header

231 Views Asked by At

I am using Wiremock standalone 2.26.3 and when I do a request to it, I always receive a http status code 413 Request Entity Too Large error.

The request uses an Authorization: Bearer xxx header and it's very long(7k chars). Other headers/cookies are several bytes only. I understand that it's the underlying Jetty which does not allow such long header.

Is there any way to bypass the limit?

1

There are 1 best solutions below

3
On

From wiremock doc, I found this: https://wiremock.org/docs/standalone/java-jar/

--jetty-header-buffer-size: Deprecated, use --jetty-header-request-size. The Jetty buffer size for request headers, e.g. --jetty-header-buffer-size 16384, defaults to 8192K.

--jetty-header-request-size: The Jetty buffer size for request headers, e.g. --jetty-header-request-size 16384, defaults to 8192K.

I think they are created just to bypass the limit and when I set it to 20000, the error is gone and my stubs are served.