Skip to content

Commit ec13879

Browse files
committed
Added compatibility options. Release 0.9.3.
1 parent dbb851e commit ec13879

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ compatible with Graal Native Image for fast startup and low resource usage.
2525

2626
## Changes
2727

28+
### 0.9.3
29+
30+
* Added `--no-keep-alive` and `--no-lowercase-headers` options to help with client compatibility.
31+
2832
### 0.9.2
2933

3034
* Issue with uhttpd GZIP compression means it is not enabled by default.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<modelVersion>4.0.0</modelVersion>
2222
<groupId>com.sshtools</groupId>
2323
<artifactId>npm2mvn</artifactId>
24-
<version>0.9.2</version>
24+
<version>0.9.3</version>
2525
<name>npm2mvn - Npm to Maven Proxy</name>
2626
<properties>
2727
<maven.compiler.target>21</maven.compiler.target>

src/main/java/com/sshtools/npm2mvn/Npm2Mvn.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ public static void main(String[] args) {
171171
@Option(names = {"-G", "--gzip-compression"}, description = "Enable GZIP compress (flaky).")
172172
private boolean compression;
173173

174+
@Option(names = {"-L", "--no-lowercase-headers"}, description = "Do not respond with lower-case headers.")
175+
private boolean noLowerCaseHeaders;
176+
177+
@Option(names = {"-A", "--no-keepalive"}, description = "Do not support keep-alive.")
178+
private boolean noKeepAlive;
179+
174180
private final TemplateProcessor processor;
175181
private final Set<String> downloading = Collections.synchronizedSet(new HashSet<>());
176182

@@ -206,8 +212,22 @@ public Integer call() throws Exception {
206212
}
207213
bindAddress.ifPresent(addr-> bldr.withHttpAddress(addr));
208214

209-
if(!compression)
215+
if(!compression) {
210216
bldr.withoutCompression();
217+
LOG.info("Disabled compression");
218+
}
219+
220+
if(noLowerCaseHeaders) {
221+
bldr.withoutSendLowerCaseHeaders();
222+
LOG.info("Disabled lower-case headers");
223+
}
224+
225+
if(noKeepAlive) {
226+
bldr.withoutKeepalive();
227+
LOG.info("Disabled keep-alive");
228+
}
229+
230+
bldr.withoutSendLowerCaseHeaders();
211231

212232
/* Mappings */
213233
bldr.get(optionalString(path, "path").map(p -> p.endsWith("/") ? p : p + "/").orElse("/") + "(.*)", this::handle);

0 commit comments

Comments
 (0)