Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_redirect_slashes_disabled (0.23 sec)

  1. tests/test_router_redirect_slashes.py

        response = client.get("/hello/", follow_redirects=False)
        assert response.status_code == 200
    
        response = client.get("/hello", follow_redirects=False)
        assert response.status_code == 307
    
    
    def test_redirect_slashes_disabled():
        app = FastAPI(redirect_slashes=False)
        router = APIRouter()
    
        @router.get("/hello/")
        def hello_page() -> str:
            return "Hello, World!"
    
        app.include_router(router)
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 22 10:37:50 GMT 2023
    - 974 bytes
    - Viewed (0)
Back to top