Commit ec133bb
refactor: optimize AsyncFileResponse handling (#240)
* refactor: optimize AsyncFileResponse handling
This refactor improves AsyncFileResponse::AsyncFileResponse(File content, const String &path, const char *contentType, bool download, AwsTemplateProcessor callback)
The updated implementation:
- Replaces the use of String::endsWith() with a more efficient memcmp() check for gzip file suffix.
- Fix the download of precompresed archives. The old behavior was wrong.
- Simplifies content-disposition header generation using consistent logic for both inline and download cases.
Overall, the refactor enhances performance slightly and ensures more consistent behavior when serving compressed downloadable files.
* Add files via upload
* Update src/WebResponses.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/WebResponses.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add files via upload
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Mathieu Carbou <mathieu.carbou@gmail.com>1 parent b658d62 commit ec133bb
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
761 | | - | |
| 761 | + | |
762 | 762 | | |
763 | 763 | | |
764 | 764 | | |
| |||
0 commit comments