Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/WebResponses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,9 @@ AsyncFileResponse::AsyncFileResponse(FS &fs, const String &path, const char *con
char *filename = (char *)path.c_str() + filenameStart;
snprintf(buf, sizeof(buf), T_attachment, filename);
addHeader(T_Content_Disposition, buf, false);
} else {
// Serve file inline (display in browser)
addHeader(T_Content_Disposition, T_inline, false);
}
// For inline display, don't set Content-Disposition header
// Browser will display inline by default when download=false

_code = 200;
}
Expand Down Expand Up @@ -782,10 +781,10 @@ AsyncFileResponse::AsyncFileResponse(File content, const String &path, const cha

if (download) {
snprintf_P(buf, sizeof(buf), PSTR("attachment; filename=\"%s\""), filename);
} else {
snprintf_P(buf, sizeof(buf), PSTR("inline"));
addHeader(T_Content_Disposition, buf, false);
}
addHeader(T_Content_Disposition, buf, false);
// For inline display, don't set Content-Disposition header
// Browser will display inline by default when download=false
}
Copy link

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing brace for the AsyncFileResponse constructor appears to be missing its function body termination. The code structure suggests this brace should be followed by the function body continuation, but the diff shows it as a standalone addition.

Copilot uses AI. Check for mistakes.

size_t AsyncFileResponse::_fillBuffer(uint8_t *data, size_t len) {
Expand Down
Loading