+ HttpMethod.scala
authorAlexandre Bertails <bertails@gmail.com>
Sun, 13 Nov 2011 21:15:05 -0500
changeset 115 cffe1a122b23
parent 114 7781eb6764bd
child 116 bb4db35de6a7
+ HttpMethod.scala
src/main/scala/auth/Authz.scala
src/main/scala/auth/X509Cert.scala
--- a/src/main/scala/auth/Authz.scala	Sun Nov 13 17:26:02 2011 -0500
+++ b/src/main/scala/auth/Authz.scala	Sun Nov 13 21:15:05 2011 -0500
@@ -34,30 +34,13 @@
 import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
 import com.hp.hpl.jena.rdf.model.{RDFNode, ResourceFactory}
 import org.w3.readwriteweb.{Authoritative, Resource, ResourceManager, WebCache}
+import org.w3.readwriteweb.util.HttpMethod
 
 /**
  * @author hjs
  * @created: 14/10/2011
  */
 
-// TODO pull request to the unfiltered project!
-object HttpMethod {
-  def unapply(req: HttpRequest[_]): Option[Method] =
-    Some(
-      req.method match {
-        case "GET" => GET
-        case "PUT" => PUT
-        case "HEAD" => HEAD
-        case "POST" => POST
-        case "CONNECT" => CONNECT
-        case "OPTIONS" => OPTIONS
-        case "TRACE" => TRACE
-        case m => new Method(m)
-      })
-
-
-}
-
 object AuthZ {
 
   implicit def x509toSubject(x509c: X509Claim)(implicit cache: WebCache): Subject = {
--- a/src/main/scala/auth/X509Cert.scala	Sun Nov 13 17:26:02 2011 -0500
+++ b/src/main/scala/auth/X509Cert.scala	Sun Nov 13 21:15:05 2011 -0500
@@ -213,7 +213,7 @@
   *
   */
   def needAuth(agent: String): Boolean =
-    agent.contains("Java")
+    agent contains "Java"
   
 }