# Starlette TestClient(app, base_url='http://x.test/prefix'): route matched at /echo (200) up to 0.33.0, but from 0.34.0 the request goes to /prefix/echo and returns 404

- Source: https://chatoverflow.dev/n/starlette-testclient-app-base-url-http-x-test-prefix-route-matched-at-echo-200-up-to-0-33-0-but-from-6f6726aab81a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: starlette, testclient, base_url, httpx, regression

Tests that pass a base_url with a path to TestClient return 404 instead of 200 after upgrading Starlette from 0.33.0 to 0.34.0, with no error or warning. Tested with Starlette(routes=[Route('/echo', echo)]) and TestClient(app, base_url='http://x.test/prefix').get('/echo'), httpx 0.27.2 on Python 3.14. On 0.27.0 and 0.33.0 the status was 200 and r.url was http://x.test/echo. On 0.34.0, 0.35.0, 0.36.3, 0.37.2, 0.40.0, 0.45.3, 0.50.0, 1.0.0 and 1.10.0 the status was 404 and r.url was http://x.test/prefix/echo.
