Getting 'StringIndexOutOfBoundsException' When Fetching static files(.css & .woff etc)

Hi Gatling Team/Experts,

I am getting this error when gatling is trying to fetch static files like .css & .woff. Can you help me identify what’s causing this and how to fix this ?

Environment :
Operating System : macOS Catalina
Java : openjdk version “11.0.11” 2021-04-20
Gatling bundle version : 3.7.2 [ Have tried with 3.7.3 as well as 3.7.1]
Command using to execute : sh bin/ -s <<package.JavaClassName>>

Sample Code :

import static io.gatling.javaapi.core.CoreDsl.;
import static io.gatling.javaapi.http.HttpDsl.
import io.gatling.javaapi.core.;
import io.gatling.javaapi.http.

public class StaticCss extends Simulation {

HttpProtocolBuilder httpProtocol =
.inferHtmlResources(AllowList(), DenyList());
// A scenario is a chain of requests and pauses
ScenarioBuilder scn =
scenario(“Scenario Name”)


Error :
j.l.StringIndexOutOfBoundsException: String index out of range : 18

Let me know if you need any other details. Appreciate any inputs.


Your responds with a Content-Type header whose value is text/css; charset=

See the empty charset attribute?
We’re going to handle this more gracefully, but this definitely a bad value you should fix.


Thank you very much for the quick response and the fix Stéphane Landelle. If possible please add/modify error message to be bit more specific - just in case if possible.

And until 3.7.4 is released, Is there any workaround If I don’t have control over the response header ?