@@ -747,10 +747,9 @@ AsyncFileResponse::AsyncFileResponse(FS &fs, const String &path, const char *con
747747 char *filename = (char *)path.c_str () + filenameStart;
748748 snprintf (buf, sizeof (buf), T_attachment, filename);
749749 addHeader (T_Content_Disposition, buf, false );
750- } else {
751- // Serve file inline (display in browser)
752- addHeader (T_Content_Disposition, T_inline, false );
753750 }
751+ // For inline display, don't set Content-Disposition header
752+ // Browser will display inline by default when download=false
754753
755754 _code = 200 ;
756755}
@@ -782,10 +781,10 @@ AsyncFileResponse::AsyncFileResponse(File content, const String &path, const cha
782781
783782 if (download) {
784783 snprintf_P (buf, sizeof (buf), PSTR (" attachment; filename=\" %s\" " ), filename);
785- } else {
786- snprintf_P (buf, sizeof (buf), PSTR (" inline" ));
784+ addHeader (T_Content_Disposition, buf, false );
787785 }
788- addHeader (T_Content_Disposition, buf, false );
786+ // For inline display, don't set Content-Disposition header
787+ // Browser will display inline by default when download=false
789788}
790789
791790size_t AsyncFileResponse::_fillBuffer (uint8_t *data, size_t len) {
0 commit comments