Skip to content

Commit e357d68

Browse files
committed
Add CORS header to redirect response
To fix usage of redirecting URL (no trailing slash) in OpenRefine
1 parent c94b7fa commit e357d68

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/controllers/HomeController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static String configNested(String id, String sub) {
117117
* @return A 301 MOVED_PERMANENTLY redirect to the path
118118
*/
119119
public Result redirectSlash(String path) {
120-
return movedPermanently("/" + path);
120+
return movedPermanently("/" + path).withHeader("Access-Control-Allow-Origin", "*");
121121
}
122122

123123
public Result index() {

conf/routes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# ~~~~
44

55
#OpenRefine reconciliation endpoint
6-
GET /gnd/reconcile controllers.Default.redirect(to = "/gnd/reconcile/")
6+
GET /gnd/reconcile controllers.HomeController.redirectSlash(path = "gnd/reconcile/")
77
POST /gnd/reconcile controllers.Reconcile.reconcile()
88
GET /gnd/reconcile/ controllers.Reconcile.main(callback ?= "", queries ?= "", extend ?= "")
99
POST /gnd/reconcile/ controllers.Reconcile.reconcile()

0 commit comments

Comments
 (0)