GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 04bf330c authored by Andreas Gärtner's avatar Andreas Gärtner

Added "OPTIONS" and "POST" to allowed CORS methods. Added custom auth

header to allowed headers.
parent 83c70a7d
......@@ -17,8 +17,9 @@ public class CorsFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
response.addHeader("Access-Control-Allow-Credentials", "true");
response.addHeader("Access-Control-Allow-Methods", "GET");
response.addHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With");
response.addHeader("Access-Control-Allow-Methods", "GET, OPTIONS, POST");
response.addHeader("Access-Control-Allow-Headers", "Content-Type, Authorization,"
+ " X-Requested-With, X-Auth-Token");
if (request.getHeader("origin") != null) {
response.addHeader("Access-Control-Allow-Origin", request.getHeader("origin"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment