mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-13 22:00:29 +05:30
Allows all methods in CORS.
See https://github.com/TeamPiped/Piped/pull/2471
This commit is contained in:
parent
276f405692
commit
67d13a4b20
@ -4,8 +4,7 @@ import io.activej.http.*;
|
||||
import io.activej.promise.Promisable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static io.activej.http.HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS;
|
||||
import static io.activej.http.HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN;
|
||||
import static io.activej.http.HttpHeaders.*;
|
||||
|
||||
public class CustomServletDecorator implements AsyncServlet {
|
||||
|
||||
@ -24,8 +23,10 @@ public class CustomServletDecorator implements AsyncServlet {
|
||||
|
||||
HttpHeaderValue headerValue = HttpHeaderValue.of("app;dur=" + (System.nanoTime() - before) / 1000000.0);
|
||||
|
||||
return response.withHeader(HEADER, headerValue).withHeader(ACCESS_CONTROL_ALLOW_ORIGIN, "*")
|
||||
.withHeader(ACCESS_CONTROL_ALLOW_HEADERS, "*, Authorization");
|
||||
return response.withHeader(HEADER, headerValue)
|
||||
.withHeader(ACCESS_CONTROL_ALLOW_ORIGIN, "*")
|
||||
.withHeader(ACCESS_CONTROL_ALLOW_HEADERS, "*, Authorization")
|
||||
.withHeader(ACCESS_CONTROL_ALLOW_METHODS, "*");
|
||||
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user