Merge pull request #8 from talltechdude/feat/index-redirect

feat: redirect root page / to /index page
This commit is contained in:
openshwprojects
2022-02-07 17:36:48 +01:00
committed by GitHub

View File

@ -873,11 +873,14 @@ int HTTP_ProcessPacket(const char *recvbuf, char *outbuf, int outBufSize, http_s
strcat(outbuf,htmlReturnToMenu);
HTTP_AddBuildFooter(outbuf,outBufSize);
strcat(outbuf,htmlEnd);
} else if(http_checkUrlBase(urlStr,"")) {
// Redirect / to /index page
strcat(outbuf,"HTTP/1.1 302 OK\nLocation: /index\nConnection: close\n\n");
} else {
http_setup(outbuf, httpMimeTypeHTML);
strcat(outbuf,htmlHeader);
strcat_safe(outbuf,g_header,outBufSize);
strcat(outbuf,"Not found.");
strcat(outbuf,"Not found.<br>\n");
strcat(outbuf,htmlReturnToMenu);
HTTP_AddBuildFooter(outbuf,outBufSize);
strcat(outbuf,htmlEnd);