Skip to content

Commit

Permalink
Add CORS header to redirect response
Browse files Browse the repository at this point in the history
To fix usage of redirecting URL (no trailing slash) in OpenRefine
  • Loading branch information
fsteeg committed Sep 16, 2024
1 parent c94b7fa commit e357d68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static String configNested(String id, String sub) {
* @return A 301 MOVED_PERMANENTLY redirect to the path
*/
public Result redirectSlash(String path) {
return movedPermanently("/" + path);
return movedPermanently("/" + path).withHeader("Access-Control-Allow-Origin", "*");
}

public Result index() {
Expand Down
2 changes: 1 addition & 1 deletion conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ~~~~

#OpenRefine reconciliation endpoint
GET /gnd/reconcile controllers.Default.redirect(to = "/gnd/reconcile/")
GET /gnd/reconcile controllers.HomeController.redirectSlash(path = "gnd/reconcile/")
POST /gnd/reconcile controllers.Reconcile.reconcile()
GET /gnd/reconcile/ controllers.Reconcile.main(callback ?= "", queries ?= "", extend ?= "")
POST /gnd/reconcile/ controllers.Reconcile.reconcile()
Expand Down

0 comments on commit e357d68

Please sign in to comment.