forked from Cookies_Github_mirror/AquaDX
[general] Add a simple boot checker and add debug message
This commit is contained in:
@@ -6,6 +6,7 @@ import icu.samnyan.aqua.sega.allnet.util.Decoder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -32,6 +33,16 @@ public class AllNetController {
|
||||
this.PORT = PORT;
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
public String root() {
|
||||
return "Server running";
|
||||
}
|
||||
|
||||
@GetMapping("/sys/test")
|
||||
public String selfTest() {
|
||||
return "Server running";
|
||||
}
|
||||
|
||||
@PostMapping(value = "/sys/servlet/PowerOn", produces = "text/plain")
|
||||
public String powerOn(InputStream dataStream) throws IOException {
|
||||
|
||||
|
||||
@@ -38,7 +38,9 @@ public class CompressionFilter extends OncePerRequestFilter {
|
||||
|
||||
byte[] reqResult;
|
||||
if (encoding != null && encoding.equals("deflate")) {
|
||||
logger.debug("Request length (compressed): {}", reqSrc.length);
|
||||
reqResult = Compression.decompress(reqSrc);
|
||||
logger.debug("Request length (decompressed): {}", reqResult.length);
|
||||
} else {
|
||||
reqResult = reqSrc;
|
||||
}
|
||||
@@ -49,7 +51,9 @@ public class CompressionFilter extends OncePerRequestFilter {
|
||||
filterChain.doFilter(requestWrapper, responseWrapper);
|
||||
|
||||
byte[] respSrc = responseWrapper.toByteArray();
|
||||
logger.debug("Response length (uncompressed): {}", respSrc.length);
|
||||
byte[] respResult = Compression.compress(respSrc);
|
||||
logger.debug("Response length (compressed): {}", respResult.length);
|
||||
|
||||
|
||||
response.setContentLength(respResult.length);
|
||||
|
||||
Reference in New Issue
Block a user