-
Describe the bug
To Reproduce
Expected behavior Environment:
Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Looks to be working with See below:
|
Beta Was this translation helpful? Give feedback.
-
Yes, it was fixed in a later version than I had--which Tiangolo pointed
out in the gitter chat. I hadn't installed it that long ago and it
never occured to me that the version could be out-of-date.
And I was using the online docs, so probably were in a later version
anyway.
All better. :)
Regards--Neil
…------ Original Message ------
From: "James Kaplan" <[email protected]>
To: "tiangolo/fastapi" <[email protected]>
Cc: "Neil Shapiro" <[email protected]>; "Author"
<[email protected]>
Sent: 7/4/2019 10:50:38 AM
Subject: Re: [tiangolo/fastapi] [BUG] (#358)
Looks to be working with 0.31.0....Was that example in the docs for
0.27.2?
See below:
from starlette.responses import Response
from starlette.testclient import TestClient
app = FastAPI()
@app.get("/headers-and-object/")
def get_headers(response: Response):
response.headers["X-Cat-Dog"] = "alone in the world"
return {"message": "Hello World"}
def test_bug():
client = TestClient(app)
r = client.get("/headers-and-object/")
assert r.headers["X-Cat-Dog"] == "alone in the world"
assert r.json() == {"message": "Hello World"}```
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#358>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABE5BMVF5TXWCVC4PJ3XLJLP5YE35ANCNFSM4H4V3AUQ>.
|
Beta Was this translation helpful? Give feedback.
-
I think this can be closed, right? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help @jekirl and @jonathanunderwood ! 🍰 I'm glad you solved your problem @nrshapiro , I'll close this now. 🎉 |
Beta Was this translation helpful? Give feedback.
Looks to be working with
0.31.0
....Was that example in the docs for0.27.2
?See below: