mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Allow POST requests for unauthenticated subscriptions
This commit is contained in:
parent
9f06b7eec2
commit
448659ea8a
1 changed files with 16 additions and 0 deletions
|
@ -329,6 +329,14 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return getErrorResponse(e, request.getPath());
|
return getErrorResponse(e, request.getPath());
|
||||||
}
|
}
|
||||||
|
})).map(POST, "/feed/unauthenticated", AsyncServlet.ofBlocking(executor, request -> {
|
||||||
|
try {
|
||||||
|
String[] subscriptions = Constants.mapper.readValue(request.loadBody().getResult().asArray(),
|
||||||
|
String[].class);
|
||||||
|
return getJsonResponse(FeedHandlers.unauthenticatedFeedResponse(subscriptions), "public, s-maxage=120");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return getErrorResponse(e, request.getPath());
|
||||||
|
}
|
||||||
})).map(GET, "/feed/unauthenticated/rss", AsyncServlet.ofBlocking(executor, request -> {
|
})).map(GET, "/feed/unauthenticated/rss", AsyncServlet.ofBlocking(executor, request -> {
|
||||||
try {
|
try {
|
||||||
return getRawResponse(FeedHandlers.unauthenticatedFeedResponseRSS(
|
return getRawResponse(FeedHandlers.unauthenticatedFeedResponseRSS(
|
||||||
|
@ -369,6 +377,14 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return getErrorResponse(e, request.getPath());
|
return getErrorResponse(e, request.getPath());
|
||||||
}
|
}
|
||||||
|
})).map(POST, "/subscriptions/unauthenticated", AsyncServlet.ofBlocking(executor, request -> {
|
||||||
|
try {
|
||||||
|
String[] subscriptions = Constants.mapper.readValue(request.loadBody().getResult().asArray(),
|
||||||
|
String[].class);
|
||||||
|
return getJsonResponse(FeedHandlers.unauthenticatedSubscriptionsResponse(subscriptions), "public, s-maxage=120");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return getErrorResponse(e, request.getPath());
|
||||||
|
}
|
||||||
})).map(POST, "/user/playlists/create", AsyncServlet.ofBlocking(executor, request -> {
|
})).map(POST, "/user/playlists/create", AsyncServlet.ofBlocking(executor, request -> {
|
||||||
try {
|
try {
|
||||||
var name = Constants.mapper.readTree(request.loadBody().getResult().asArray()).get("name").textValue();
|
var name = Constants.mapper.readTree(request.loadBody().getResult().asArray()).get("name").textValue();
|
||||||
|
|
Loading…
Reference in a new issue