Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
requests getting sent to right subdomain agent #6
Browse files Browse the repository at this point in the history
  • Loading branch information
bblfish committed Nov 24, 2013
1 parent 78c90f6 commit 67ce4b3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
21 changes: 17 additions & 4 deletions app/Global.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,25 @@
import controllers.routes
import play.api._
import mvc.RequestHeader
import java.net._

object Global extends GlobalSettings {
override def onRouteRequest(request: RequestHeader) = {
override def onRouteRequest(req: RequestHeader) = {
import rww.play.EnhancedRequestHeader
println("**********************using MyGlobal!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + request.getAbsoluteURI)
//println(request.path +"----"+ routes.ReadWriteWebApp.get("").absoluteURL(true))
super.onRouteRequest(request)

val uri = req.getAbsoluteURI



if (uri.getHost != "localhost") {
req.method match {
case "GET" => Some(controllers.ReadWriteWebApp.get(req.path))
case "POST" => Some(controllers.ReadWriteWebApp.post(req.path))
case "PATCH" => Some(controllers.ReadWriteWebApp.patch(req.path))
case "MKCOL" => Some(controllers.ReadWriteWebApp.mkcol(req.path))
case "DELETE" => Some(controllers.ReadWriteWebApp.delete(req.path))

}
} else super.onRouteRequest(req)
}
}
7 changes: 6 additions & 1 deletion test_www/test/.acl.ttl
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

[] acl:accessToClass [ acl:regex "https://test.localhost:8443/.*" ];
acl:mode acl:Read, acl:Write;
acl:agent <card#me> .

<.acl> <http://www.w3.org/ns/auth/acl#include> <https://localhost:8443/2013/.acl> .

0 comments on commit 67ce4b3

Please sign in to comment.