Package com.pugh.sockso.web.action

Source Code of com.pugh.sockso.web.action.FileServerTest

package com.pugh.sockso.web.action;

import com.pugh.sockso.tests.SocksoTestCase;
import com.pugh.sockso.tests.TestRequest;



public class FileServerTest extends SocksoTestCase {

    private FileServer action;
   
    @Override
    protected void setUp() {
        action = new FileServer( null );
    }


    public void testFileServerIgnoresLogins() {
        assertFalse( action.requiresLogin() );
    }

    public void testDoubleDotsAreIgnoredInFilePaths() throws Exception {
        TestRequest req = new TestRequest( "GET /file/some/../../..../file.txt HTTP/1.0" );
        action.setRequest( req );
        assertEquals( "htdocs/some/file.txt", action.getPathFromRequest() );
    }

}
TOP

Related Classes of com.pugh.sockso.web.action.FileServerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.