Revisions
-
kareblak revised this gist
Jan 9, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import unfiltered.response._ object Secure { def secure[A,B](intent: unfiltered.Cycle.Intent[A,B]) = { case req@ForwardedProto(proto) if (intent.isDefinedAt(req)) => intent(wrap(req, "https" == proto.toLowerCase)) case req if (intent.isDefinedAt(req)) => intent(req) } -
hamnis revised this gist
Jan 9, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import unfiltered.response._ object Secure { def secure[A,B](intent: unfiltered.Cycle.Intent[A,B]) = { case req@ForwardedProto(proto) if (intent.isDefinedAt(intent)) => intent(wrap(req, "https" == proto.toLowerCase)) case req if (intent.isDefinedAt(req)) => intent(req) } -
hamnis created this gist
Jan 9, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ package unfilteredx.kit import unfiltered.request._ import unfiltered.response._ object Secure { def secure[A,B](intent: unfiltered.Cycle.Intent[A,B]) = { case req@ForwardedProto(proto) if (intent.isDefinedAt(intent) => intent(wrap(req, "https" == proto.toLowerCase)) case req if (intent.isDefinedAt(req)) => intent(req) } private def wrap[A](req: HttpRequest[A], secure: Boolean) = new DelegatingRequest(req) { override def isSecure = secure } } object ForwardedProto extends StringHeader("Forwarded-Proto")