mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Fix compile error.
This commit is contained in:
parent
05ac540b02
commit
9275e01c5a
1 changed files with 16 additions and 24 deletions
|
@ -228,11 +228,7 @@ public class Main {
|
|||
}).compress(true).bindNow();
|
||||
|
||||
server.onDispose().block();
|
||||
}
|
||||
|
||||
}).bindNow();
|
||||
|
||||
Thread.sleep(Long.MAX_VALUE);
|
||||
}
|
||||
|
||||
public static NettyOutbound writeResponse(HttpServerResponse res, String resp, int code, String cache, long time) {
|
||||
|
@ -258,11 +254,9 @@ public class Main {
|
|||
return writeResponse(res, resp, mimeType.toString(), code, cache, time);
|
||||
}
|
||||
|
||||
public static NettyOutbound writeResponse(HttpServerResponse res, byte[] resp, String mimeType, int code, String cache, long time) {
|
||||
return res
|
||||
.status(code)
|
||||
.addHeader(CONTENT_TYPE, mimeType)
|
||||
.addHeader(ACCESS_CONTROL_ALLOW_ORIGIN, "*")
|
||||
public static NettyOutbound writeResponse(HttpServerResponse res, byte[] resp, String mimeType, int code,
|
||||
String cache, long time) {
|
||||
return res.status(code).addHeader(CONTENT_TYPE, mimeType).addHeader(ACCESS_CONTROL_ALLOW_ORIGIN, "*")
|
||||
.addHeader(CACHE_CONTROL, cache)
|
||||
.addHeader("Server-Timing", "app;dur=" + (System.nanoTime() - time) / 1000000.0)
|
||||
.sendByteArray(Flux.just(resp));
|
||||
|
@ -277,11 +271,9 @@ public class Main {
|
|||
return writeResponse(res, resp, mimeType.toString(), code, cache);
|
||||
}
|
||||
|
||||
public static NettyOutbound writeResponse(HttpServerResponse res, Flux<String> resp, String mimeType, int code, String cache) {
|
||||
return res
|
||||
.status(code)
|
||||
.addHeader(CONTENT_TYPE, mimeType)
|
||||
.addHeader(ACCESS_CONTROL_ALLOW_ORIGIN, "*")
|
||||
public static NettyOutbound writeResponse(HttpServerResponse res, Flux<String> resp, String mimeType, int code,
|
||||
String cache) {
|
||||
return res.status(code).addHeader(CONTENT_TYPE, mimeType).addHeader(ACCESS_CONTROL_ALLOW_ORIGIN, "*")
|
||||
.addHeader(CACHE_CONTROL, cache)
|
||||
.send(ByteBufFlux.fromString(resp, java.nio.charset.StandardCharsets.UTF_8, ByteBufAllocator.DEFAULT));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue