Permalink
Browse files

[#1441] Fix DBPlugin redirect domain

  • Loading branch information...
reinra committed Mar 9, 2012
1 parent 056c8b3 commit 243f13a6c61f36c47a2242f69163ac144f79e47f
Showing with 4 additions and 1 deletion.
  1. +4 −1 framework/src/play/db/DBPlugin.java
@@ -48,7 +48,10 @@ public boolean rawInvocation(Request request, Response response) throws Exceptio
h2Server = org.h2.tools.Server.createWebServer();
h2Server.start();
- response.setHeader("Location", "http://localhost:8082/");
+ String domain = request.domain;
+ if (domain.equals(""))
+ domain = "localhost";
+ response.setHeader("Location", "http://" + domain + ":8082/");
return true;
}
return false;

2 comments on commit 243f13a

@bplawler

This comment has been minimized.

Show comment Hide comment
@bplawler

bplawler Mar 9, 2012

The other important part of my original commit was the "-webAllowOthers" option passed into h2server.start(). Without that h2 will deny access. Is that handled in some other way in this patch? If not, then the redirect will be to the correct place but the user will still not have access to the console.

The other important part of my original commit was the "-webAllowOthers" option passed into h2server.start(). Without that h2 will deny access. Is that handled in some other way in this patch? If not, then the redirect will be to the correct place but the user will still not have access to the console.

@reinra

This comment has been minimized.

Show comment Hide comment
@reinra

reinra Mar 10, 2012

Owner

I was not aware of your commit as it was not mentioned on the ticket, the issue was not fixed in 1.2.x and our project does not work with the master branch so I did not check that.

I just checked the redirect URL in the browser, didn't handle the "webAllowOthers" option, should check if it works from another machine.
At the same I saw that the request.domain can be "" so I handled that case.

Owner

reinra replied Mar 10, 2012

I was not aware of your commit as it was not mentioned on the ticket, the issue was not fixed in 1.2.x and our project does not work with the master branch so I did not check that.

I just checked the redirect URL in the browser, didn't handle the "webAllowOthers" option, should check if it works from another machine.
At the same I saw that the request.domain can be "" so I handled that case.

Please sign in to comment.