This is an automated email from the ASF dual-hosted git repository. kaspersor pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/metamodel-membrane.git
commit 7224097411055b9a9ebe458f6f70e7c7c20fdee5 Author: Nicola Vitucci <nicola.vitu...@gmail.com> AuthorDate: Fri May 24 11:35:07 2019 +0100 Add files via upload --- .../metamodel/membrane/server/CorsHandlers.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/undertow/src/main/java/org/apache/metamodel/membrane/server/CorsHandlers.java b/undertow/src/main/java/org/apache/metamodel/membrane/server/CorsHandlers.java new file mode 100644 index 0000000..8e21d40 --- /dev/null +++ b/undertow/src/main/java/org/apache/metamodel/membrane/server/CorsHandlers.java @@ -0,0 +1,28 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.metamodel.membrane.server; + +import io.undertow.server.HttpHandler; +import io.undertow.server.handlers.SetHeaderHandler; + +public class CorsHandlers { + public HttpHandler allowOrigin(HttpHandler next) { + return new SetHeaderHandler(next, "Access-Control-Allow-Origin", "*"); + } +}