You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using c.Download() to send files within a handler. Sometimes it responses with 304. However, I want it to always respond with 200 (assuming the file is found).
@xEricL HTTP 304 Not Modified is a status code used to indicate that the requested resource has not changed since the last time it was requested, and therefore, the client can continue to use the cached version of the resource instead of re-downloading it. This status code is typically used in conjunction with HTTP headers like If-Modified-Since or If-None - Match. This ia why you see HTTP 200 for the first request, but 304 after.
@gaby yeah I understand the status code. But in my case, requests are made from a java app, not from a browser. The java app expects a 200, but instead the client is receiving a 304, which would cause the client-side code to fail if it errors out on non-200 responses.
I understand that this can be disabled if I'm using App.Static(). However, there doesn't seem to be a way to disable it for c.SendFile() responses in a regular handler.
Question Description
I am using
c.Download()
to send files within a handler. Sometimes it responses with 304. However, I want it to always respond with 200 (assuming the file is found).How can I do that? Is it as simple as:
I believe the 304 response mechanism was implemented in response to this bug report #516
However, it appears that the solution assumes the app is sending files to a browser. In my case, requests made to my app do not come from a browser.
Code Snippet (optional)
No response
Checklist:
The text was updated successfully, but these errors were encountered: