wiremock / wiremock/wiremock

User provided filepath not considered for bigger size responses (>10Kb)

Open
#2,113 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
7.4k
Forks
1.5k
Avg merge
13h 10m
Merged PRs (30d)
16

Description

We are starting wiremock in plain java way with custom path as below.

WireMockServer wireMockServer = new WireMockServer(options().port(8089).usingFilesUnderDirectory("/customPath"));
wireMockServer.start();

We observe body was null after stopping wiremock.
Found if response size is > 10kb, this code is looking for default constant path not user provided path.

Pls note this issue occurs only when response size is bigger than 10KB.
We found workaround for this issue. We increased default body size using extractTextBodiesOver to fix this. But this is just work around.

At above mentioned line, I think we have to consider user provided path instead of default. I can try to fix this if its not in pipeline.

Thanks,
Rajesh

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked code in src/main/java/com/github/tomakehurst/wiremock/store/Stores.java and trace how usingFilesUnderDirectory("/customPath") is passed into response-body storage. Reproduce the issue with a response larger than 10KB, then verify that stopping WireMock preserves the body under the user-provided path without relying on extractTextBodiesOver.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.