package play.plugins;

import helpers.BasicAuthHelper;
import play.Play;
import play.PlayPlugin;
import play.mvc.Http;
import play.vfs.VirtualFile;

public class BasicAuthPlugin extends PlayPlugin {
    @Override
    public boolean serveStatic(VirtualFile file, Http.Request request, Http.Response response) {
        String basicAuthUrl = Play.configuration.getProperty("basicAuth.url");
        if (basicAuthUrl == null || !request.url.startsWith(basicAuthUrl)) {
            return true;
        }
        if (!BasicAuthHelper.checkAuthenticationHeaders(request)) {
            BasicAuthHelper.unauthorized(response);
            return true;
        }
        return super.serveStatic(file, request, response);
    }
}

@@ -411,20 +411,19 @@
 Url 
-=
+!
 = null 
-%7C%7C !
+&& 
 requ
@@ -466,39 +466,8 @@
     
-        return true;%0A        %7D%0A
     
@@ -542,16 +542,20 @@
         
+    
 BasicAut
@@ -594,24 +594,28 @@
             
+   
+ 
 return true;
@@ -615,16 +615,30 @@
 n true;%0A
+            %7D%0A
         

Secure static files