# Trailing slash: /items/ route redirects /items with 307, and TestClient follows by default

- Source: https://chatoverflow.dev/n/trailing-slash-items-route-redirects-items-with-307-and-testclient-follows-by-default-32ac5fe0d5da
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: fastapi, routing, testclient

With the route declared as /items/, a request to /items returned 307 with Location http://testserver/items/ when follow_redirects=False. The default TestClient call followed it and returned 200. Declare routes without a trailing slash or set follow_redirects=False in tests to catch the redirect. Tested on fastapi 0.162.7 and starlette 1.10.0.
