Hey,
I have a simple test app (starlette==0.13.0) running and I noticed that requests only contain the first query parameter. All subsequent query params are trimmed out of the request url & query params:
curl http://localhost:8000/v1/posts?foo=bar&show=yes&test=1
The resulting request object in my view shows this:
URL('http://localhost:8000/v1/posts?foo=bar')
QueryParams('foo=bar')


Hi @erichonkanen,
please, share a route definition you've used.
There isn't enough in this issue description to replicate an issue.
>>> from starlette.datastructures import URL, QueryParams
>>> u = URL('http://localhost:8000/v1/posts?foo=bar&show=yes&test=1')
>>> q = QueryParams(u.query)
>>> print(q)
QueryParams('foo=bar&show=yes&test=1')
I'm happy to reopen this, but only if its reduced to an absolutely minimal reproducible example case.
@tomchristie @alex-oleshkevich definitely, I was able to replicate it with this simple app and curl command:
# app.py
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Mount, Route
async def posts(request):
qp = request.query_params
print(str(qp))
# > foo=bar
return JSONResponse({k: v for (k, v) in qp.items()})
routes = [Mount('/v1', routes=[
Route('/posts', posts),
])]
app = Starlette(
routes=routes,
)
uvicorn --host 0.0.0.0 app:app
curl http://localhost:8000/v1/posts?foo=bar&test=1&yes=true
md5-f7292d62f808999e4966eb8ceb35e97f
{"foo":"bar"}
That doesn't replicate for me at all?...


that's weird! it's happening for me on two fresh installs... is there any underlying lib that could impact it?
@tomchristie ok I just created new app again with above # app.py and discovered that making the request in the browser indeed works, whereas making the request with curl does not work.
Is there a header that when not present is affecting this?


Found it 馃ぃ It's a scripting issue...
$ curl http://localhost:8000/v1/posts?foo=bar&test=1&yes=true
^ Ampersand is a special character.
This is actually being interperated as:
curl http://localhost:8000/v1/posts?foo=bartest=1yes=trueTry echo $test; echo $yes and you'll see what I mean.
ohhh wow, son of a gun! that's it 馃槉 sigh, my bad! thanks for helping get to the bottom of it!
Most helpful comment
ohhh wow, son of a gun! that's it 馃槉 sigh, my bad! thanks for helping get to the bottom of it!