mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-04-29 00:10:31 +05:30
More cleanup.
This commit is contained in:
parent
9e89d13518
commit
669f1a7308
@ -38,8 +38,7 @@ public class Main {
|
|||||||
QueryStringDecoder query = new QueryStringDecoder(req.uri());
|
QueryStringDecoder query = new QueryStringDecoder(req.uri());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return res.compression(true).addHeader("Cache-Control", "private")
|
return writeResponse(res, query.parameters().get("hub.challenge").get(0), 200, "private");
|
||||||
.send(ByteBufFlux.fromString(Flux.just(query.parameters().get("hub.challenge").get(0))));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return writeResponse(res, ExceptionUtils.getStackTrace(e), 500, "private");
|
return writeResponse(res, ExceptionUtils.getStackTrace(e), 500, "private");
|
||||||
@ -51,8 +50,7 @@ public class Main {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
req.receive().asString().subscribe(str -> System.out.println(str));
|
req.receive().asString().subscribe(str -> System.out.println(str));
|
||||||
return res.compression(true).addHeader("Cache-Control", "private")
|
return writeResponse(res, "ok", 200, "private");
|
||||||
.send(ByteBufFlux.fromString(Flux.just("ok")));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return writeResponse(res, ExceptionUtils.getStackTrace(e), 500, "private");
|
return writeResponse(res, ExceptionUtils.getStackTrace(e), 500, "private");
|
||||||
@ -78,9 +76,8 @@ public class Main {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// The stream links are valid for 6 hours.
|
// The stream links are valid for 6 hours.
|
||||||
return res.compression(true).addHeader("Access-Control-Allow-Origin", "*")
|
return writeResponse(res, ResponseHelper.streamsResponse(req.param("videoId")), 200,
|
||||||
.addHeader("Cache-Control", "public, s-maxage=21540").send(ByteBufFlux
|
"public, s-maxage=21540");
|
||||||
.fromString(Flux.just(ResponseHelper.streamsResponse(req.param("videoId")))));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return writeResponse(res, ExceptionUtils.getStackTrace(e), 500, "private");
|
return writeResponse(res, ExceptionUtils.getStackTrace(e), 500, "private");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user