Skip to content

Commit 56aab1b

Browse files
authored
Merge pull request #235 from xdev-software/develop
Release
2 parents 80bf13d + 4a461b3 commit 56aab1b

File tree

18 files changed

+97
-91
lines changed

18 files changed

+97
-91
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
# Force MVN Wrapper Linux files LF
88
mvnw text eol=lf
9-
.mvn/wrapper/maven-wrapper.properties text eol=lf
9+
maven-wrapper.properties text eol=lf

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ body:
3333
validations:
3434
required: true
3535

36+
- type: textarea
37+
id: description
38+
attributes:
39+
label: Description of the problem
40+
description: |
41+
Describe as exactly as possible what is not working.
42+
validations:
43+
required: true
44+
3645
- type: textarea
3746
id: steps-to-reproduce
3847
attributes:
@@ -47,20 +56,6 @@ body:
4756
validations:
4857
required: true
4958

50-
- type: textarea
51-
id: expected-behavior
52-
attributes:
53-
label: Expected behavior
54-
description: |
55-
Tell us what you expect to happen.
56-
57-
- type: textarea
58-
id: actual-behavior
59-
attributes:
60-
label: Actual behavior
61-
description: |
62-
Tell us what happens with the steps given above.
63-
6459
- type: textarea
6560
id: additional-information
6661
attributes:

.github/workflows/image-vuln-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
- uses: actions/checkout@v4
2121

2222
- name: Scan - Full
23-
uses: aquasecurity/trivy-action@0.30.0
23+
uses: aquasecurity/trivy-action@0.31.0
2424
with:
2525
image-ref: ${{ env.TRIVYY_IMAGE_REF }}
2626

2727
- name: Scan - Relevant
2828
id: scan_relevant
29-
uses: aquasecurity/trivy-action@0.30.0
29+
uses: aquasecurity/trivy-action@0.31.0
3030
with:
3131
image-ref: ${{ env.TRIVYY_IMAGE_REF }}
3232
exit-code: 1

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.10/apache-maven-3.9.10-bin.zip

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.18
2+
* Updated dependencies
3+
* Fix ``subString`` matching not working as expected #231
4+
15
# 1.0.17
26
* Migrated deployment to _Sonatype Maven Central Portal_ [#155](https://github.com/xdev-software/standard-maven-template/issues/155)
37
* Updated dependencies

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ new MockServerClient("localhost", 1080)
124124

125125
</details>
126126

127-
### Further documentation
127+
### Further related documentation
128128
* [Original project](https://www.mock-server.com/)
129-
* [Testcontainers Mockserver module](https://java.testcontainers.org/modules/mockserver/)
129+
* [Testcontainers (original) Mockserver module](https://java.testcontainers.org/modules/mockserver/)
130130

131-
MockServer also works really well together with a network failure simulation tools such as [ToxiProxy](https://java.testcontainers.org/modules/toxiproxy/).
131+
Note: MockServer also works really well together with a network failure simulation tools such as [ToxiProxy](https://java.testcontainers.org/modules/toxiproxy/).
132132

133133
## Installation
134134
[Installation guide for the latest release](https://github.com/xdev-software/mockserver-neolight/releases/latest#Installation)

client/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
<dependency>
218218
<groupId>com.puppycrawl.tools</groupId>
219219
<artifactId>checkstyle</artifactId>
220-
<version>10.23.1</version>
220+
<version>10.25.0</version>
221221
</dependency>
222222
</dependencies>
223223
<configuration>
@@ -247,19 +247,19 @@
247247
<includeTests>true</includeTests>
248248
<printFailingErrors>true</printFailingErrors>
249249
<rulesets>
250-
<ruleset>../.config/pmd/ruleset.xml</ruleset>
250+
<ruleset>../.config/pmd/java/ruleset.xml</ruleset>
251251
</rulesets>
252252
</configuration>
253253
<dependencies>
254254
<dependency>
255255
<groupId>net.sourceforge.pmd</groupId>
256256
<artifactId>pmd-core</artifactId>
257-
<version>7.13.0</version>
257+
<version>7.14.0</version>
258258
</dependency>
259259
<dependency>
260260
<groupId>net.sourceforge.pmd</groupId>
261261
<artifactId>pmd-java</artifactId>
262-
<version>7.13.0</version>
262+
<version>7.14.0</version>
263263
</dependency>
264264
</dependencies>
265265
</plugin>

core/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<dependency>
6262
<groupId>io.netty</groupId>
6363
<artifactId>netty-bom</artifactId>
64-
<version>4.2.1.Final</version>
64+
<version>4.2.2.Final</version>
6565
<type>pom</type>
6666
<scope>import</scope>
6767
</dependency>
@@ -275,7 +275,7 @@
275275
<dependency>
276276
<groupId>com.puppycrawl.tools</groupId>
277277
<artifactId>checkstyle</artifactId>
278-
<version>10.23.1</version>
278+
<version>10.25.0</version>
279279
</dependency>
280280
</dependencies>
281281
<configuration>
@@ -305,19 +305,19 @@
305305
<includeTests>true</includeTests>
306306
<printFailingErrors>true</printFailingErrors>
307307
<rulesets>
308-
<ruleset>../.config/pmd/ruleset.xml</ruleset>
308+
<ruleset>../.config/pmd/java/ruleset.xml</ruleset>
309309
</rulesets>
310310
</configuration>
311311
<dependencies>
312312
<dependency>
313313
<groupId>net.sourceforge.pmd</groupId>
314314
<artifactId>pmd-core</artifactId>
315-
<version>7.13.0</version>
315+
<version>7.14.0</version>
316316
</dependency>
317317
<dependency>
318318
<groupId>net.sourceforge.pmd</groupId>
319319
<artifactId>pmd-java</artifactId>
320-
<version>7.13.0</version>
320+
<version>7.14.0</version>
321321
</dependency>
322322
</dependencies>
323323
</plugin>

core/src/main/java/software/xdev/mockserver/mappers/MockServerHttpResponseToFullHttpResponse.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ private ByteBuf getBody(final HttpResponse httpResponse)
132132
httpResponse.getFirstHeader(CONTENT_TYPE.toString()));
133133
}
134134

135-
@SuppressWarnings("PMD.CognitiveComplexity")
136135
private void setHeaders(final HttpResponse httpResponse, final DefaultHttpResponse response, final ByteBuf body)
137136
{
138137
if(httpResponse.getHeaderMultimap() != null)
@@ -149,15 +148,26 @@ private void setHeaders(final HttpResponse httpResponse, final DefaultHttpRespon
149148
);
150149
}
151150

152-
// Content-Type
151+
setContentTypeHeader(httpResponse, response);
152+
setContentLengthHeader(httpResponse, response, body);
153+
setHTTP2ExtensionHeaders(httpResponse, response);
154+
}
155+
156+
protected static void setContentTypeHeader(final HttpResponse httpResponse, final DefaultHttpResponse response)
157+
{
153158
if(isBlank(httpResponse.getFirstHeader(CONTENT_TYPE.toString()))
154159
&& httpResponse.getBody() != null
155160
&& httpResponse.getBody().getContentType() != null)
156161
{
157162
response.headers().set(CONTENT_TYPE, httpResponse.getBody().getContentType());
158163
}
159-
160-
// Content-Length
164+
}
165+
166+
protected static void setContentLengthHeader(
167+
final HttpResponse httpResponse,
168+
final DefaultHttpResponse response,
169+
final ByteBuf body)
170+
{
161171
final ConnectionOptions connectionOptions = httpResponse.getConnectionOptions();
162172
if(isBlank(httpResponse.getFirstHeader(CONTENT_LENGTH.toString())))
163173
{
@@ -181,8 +191,10 @@ else if(addContentLength && !chunkedEncoding)
181191
response.headers().set(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED);
182192
}
183193
}
184-
185-
// HTTP2 extension headers
194+
}
195+
196+
protected static void setHTTP2ExtensionHeaders(final HttpResponse httpResponse, final DefaultHttpResponse response)
197+
{
186198
final Integer streamId = httpResponse.getStreamId();
187199
if(streamId != null)
188200
{

0 commit comments

Comments
 (0)