Skip to content

Commit

Permalink
Use const for http header.
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueAndi committed Jan 14, 2025
1 parent 865bb5f commit 54631a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/RestApiTopicHandler/src/RestApiTopicHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ void RestApiTopicHandler::uploadHandler(AsyncWebServerRequest* request, const St
/* Begin of upload? */
if (0 == index)
{
AsyncWebHeader* headerXFileSize = request->getHeader("X-File-Size");
size_t fileSize = request->contentLength();
size_t fileSystemSpace = FILESYSTEM.totalBytes() - FILESYSTEM.usedBytes();
const AsyncWebHeader* headerXFileSize = request->getHeader("X-File-Size");
size_t fileSize = request->contentLength();
size_t fileSystemSpace = FILESYSTEM.totalBytes() - FILESYSTEM.usedBytes();

/* File size available? */
if (nullptr != headerXFileSize)
Expand Down
10 changes: 5 additions & 5 deletions src/Web/Pages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ static void uploadHandler(AsyncWebServerRequest* request, const String& filename
/* Begin of upload? */
if (0 == index)
{
uint32_t fileSize = UPDATE_SIZE_UNKNOWN;
int cmd = U_FLASH;
AsyncWebHeader* headerXFileSize = nullptr;
bool isFilesystemUpdate = false;
uint32_t fileSize = UPDATE_SIZE_UNKNOWN;
int cmd = U_FLASH;
const AsyncWebHeader* headerXFileSize = nullptr;
bool isFilesystemUpdate = false;

/* If there is a pending upload, abort it. */
if (true == Update.isRunning())
Expand Down Expand Up @@ -542,7 +542,7 @@ static void uploadHandler(AsyncWebServerRequest* request, const String& filename
{
/* Finish update now. */
if (false == Update.end(true))
{
{
gIsUploadError = true;
}
/* Update was successful! */
Expand Down

0 comments on commit 54631a2

Please sign in to comment.