What I’m trying to do:
Since yesterday evening suddenly none of the download links work anymore. I did not change anything in the code during the last week.
Here is the code (simplified to show you the error):
@anvil.server.http_endpoint("/test_bug/:row")
def test_bug(row, **params): #✔️
r = anvil.server.HttpResponse()
r.headers['content-disposition'] = 'attachment; filename="{}"'.format("test.apkg")
This is the error I get:
TypeError: ‘NoneType’ object does not support item assignmentat [ServerModule1, line 45](javascript:void(0))called from anvil/_server.py, line 1336
Line 45 would be the last line in the example above.
What I’ve tried and what’s not working:
An example from the docs:
@anvil.server.http_endpoint("/foo")
def serve_content():
return anvil.server.HttpResponse(200, "Body goes here")
This one crashes with the following error:
AttributeError: ‘NoneType’ object has no attribute ‘_headers’
at anvil/_server.py, line 1343