-
Notifications
You must be signed in to change notification settings - Fork 282
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Adding BackgroundTask
to Redirect
response results in 200 status code.
Minimal Reproducible Example
app = FastHTML()
cli = TestClient(app, follow_redirects=False)
@app.get("/background")
def background_task():
def long_running_task():
time.sleep(0.1)
print("Background task completed!")
return Redirect("/"), BackgroundTask(long_running_task)
r = cli.get("/background")
print(r)
print(r.text)
Output:
Background task completed!
<Response [200 OK]>
<!doctype html>
<html>
<head>
<title>FastHTML page</title>
<meta charset="utf-8">
...
<body><fasthtml.core.Redirect object at 0x103863cb0></body>
</html>
Expected behavior
Expect response. with 303 status code
Environment Information
Please provide the following version information:
- fastlite version: 0.1.3
- fastcore version: 1.8.1
- fasthtml version: 0.12.5
Confirmation
Please confirm the following:
- I have read the FAQ (https://docs.fastht.ml/explains/faq.html)
- I have provided a minimal reproducible example
- I have included the versions of fastlite, fastcore, and fasthtml
- I understand that this is a volunteer open source project with no commercial support.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working