@@ -0,0 +1,1747 @@
+/*%0A * RandomUser %E2%80%93 Provide random user data as a demo service for RESTful clients%0A * Copyright (C) 2016 Marcus Fihlon%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0Apackage ch.dockergarten.randomuser;%0A%0Aimport javax.ws.rs.container.ContainerRequestContext;%0Aimport javax.ws.rs.container.ContainerResponseContext;%0Aimport javax.ws.rs.container.ContainerResponseFilter;%0Aimport javax.ws.rs.ext.Provider;%0A%0A@Provider%0Apublic class CORSFilter implements ContainerResponseFilter %7B%0A%0A    @Override%0A    public void filter(final ContainerRequestContext requestContext,%0A                       final ContainerResponseContext responseContext) %7B%0A        responseContext.getHeaders().add(%22Access-Control-Allow-Origin%22, %22*%22);%0A        responseContext.getHeaders().add(%22Access-Control-Allow-Headers%22, %22origin, content-type, accept, authorization%22);%0A        responseContext.getHeaders().add(%22Access-Control-Allow-Credentials%22, %22true%22);%0A        responseContext.getHeaders().add(%22Access-Control-Allow-Methods%22, %22GET, POST, PUT, DELETE, OPTIONS, HEAD%22);%0A        responseContext.getHeaders().add(%22Access-Control-Max-Age%22, %2286400%22); // 24h%0A    %7D%0A%0A%7D%0A

Allow cross domain requests