@@ -0,0 +1,1308 @@
+/*%0A * Copyright 2020 Micro Focus International plc.%0A * Licensed under the MIT License (the %22License%22); you may not use this file except in compliance with the License.%0A */%0A%0Apackage com.hp.autonomy.frontend.find.core.web;%0A%0Aimport org.springframework.http.HttpMethod;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.stereotype.Component;%0Aimport org.springframework.web.filter.OncePerRequestFilter;%0A%0Aimport javax.servlet.FilterChain;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.io.IOException;%0A%0A/**%0A * The OPTIONS HTTP method is seen by some as a security issue.  The Find API isn't documented, so%0A * we don't need CORS, so we don't need OPTIONS - so just disable it.%0A */%0A@Component%0Apublic class DisallowOptionsRequestFilter extends OncePerRequestFilter %7B%0A%0A    @Override%0A    protected void doFilterInternal(%0A        final HttpServletRequest request,%0A        final HttpServletResponse response,%0A        final FilterChain chain%0A    ) throws ServletException, IOException %7B%0A        if (HttpMethod.OPTIONS.matches(request.getMethod())) %7B%0A            response.sendError(HttpStatus.METHOD_NOT_ALLOWED.value());%0A        %7D else %7B%0A            chain.doFilter(request, response);%0A        %7D%0A    %7D%0A%0A%7D%0A

disable HTTP OPTIONS