Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
NevermindExpress authored Nov 25, 2022
1 parent 784b601 commit 7b2df42
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Alyssa.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ extern bool HSTS;

// Definition of constant values
static char separator = 1;
static string version = "v1.1";
static string version = "v1.1.1";

#ifdef COMPILE_OPENSSL
// SSL stuff
Expand Down
10 changes: 5 additions & 5 deletions Alyssa.rc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,0,0
PRODUCTVERSION 1,1,0,0
FILEVERSION 1,1,1,0
PRODUCTVERSION 1,1,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -67,14 +67,14 @@ BEGIN
BEGIN
BLOCK "040004b0"
BEGIN
VALUE "CompanyName", "TODO: <�irket ad�>"
VALUE "CompanyName", "PEPSIMANTR"
VALUE "FileDescription", "Alyssa HTTP Server Project"
VALUE "FileVersion", "v1.1"
VALUE "FileVersion", "v1.1.1"
VALUE "InternalName", "AlyssaHTTP.exe"
VALUE "LegalCopyright", "Copyright (C) 2022 PEPSIMANTR"
VALUE "OriginalFilename", "AlyssaHTTP.exe"
VALUE "ProductName", "Alyssa HTTP Server Project"
VALUE "ProductVersion", "v1.1"
VALUE "ProductVersion", "v1.1.1"
END
END
BLOCK "VarFileInfo"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Alyssa HTTP Server Changelog
------------------------------

v1.1.1 - 25.11.2022
� Fixed bugs related to requests to root of any folder and responses with index.html files on that folders (infinite page loadings, browser pretending as binary files and downloads it and etc.).
� Fixed missing file count on directory indexes when there is only one file.

v1.1 - 25.11.2022
� Added basic logging support.
� Fixed the CGI which got broken on previous update.
Expand Down
3 changes: 2 additions & 1 deletion Folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ std::string Folder::HTML(std::string payload, std::string relpath) {
if (folderc > 1) htm += "s";// If plural, add "s"
}
if (filec > 0) {
if (folderc > 0) { htm += " and " + std::to_string(filec) + " file"; }
if (folderc > 0) { htm += " and "; }
htm += std::to_string(filec) + " file";
if (filec > 1) htm += "s";// If plural, add "s"
}
if (folderc > 0 || filec > 0) htm += "<br>"; // Only add a break when any item exists, for eliminating the empty line before version if folder is empty.
Expand Down
10 changes: 7 additions & 3 deletions Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ class AlyssaHTTP {//This class has main code for responses to client
if (fileExists(htroot + "/root.htaccess")) {
if (!customActions(htroot + "/root.htaccess", cl)) { if (cl->close) { shutdown(sock, 2); closesocket(sock); } return; }
} //Check for the special rules first
else if (fileExists(htroot + "/index.html")) { file.open((std::filesystem::u8path(htroot + "/index.html"))); filesize = std::filesystem::file_size((std::filesystem::u8path(htroot + "/index.html")));
else if (fileExists(htroot + "/index.html")) {
path = "/index.html";
file.open(std::filesystem::u8path(htroot + path), std::ios::binary); filesize = std::filesystem::file_size(std::filesystem::u8path(htroot + path));
} //Check for index.html, which is default filename for webpage on root of any folder.
else if (foldermode) {
string asd = Folder::folder(htroot + "/"); asd = serverHeaders(200, cl, "text/html", asd.size()) + "\r\n" + asd;
Expand All @@ -314,7 +316,8 @@ class AlyssaHTTP {//This class has main code for responses to client
if (!customActions(htroot + path + "/root.htaccess", cl)) { if (cl->close) { shutdown(sock, 2); closesocket(sock); } return; }
}
if (fileExists(htroot + path + "/index.html")) {//Check for index.html
file.open(std::filesystem::u8path(htroot + path + "/index.html"), std::ios::binary); filesize = std::filesystem::file_size(std::filesystem::u8path(htroot + path + "/index.html"));
path += "/index.html";
file.open(std::filesystem::u8path(htroot + path), std::ios::binary); filesize = std::filesystem::file_size(std::filesystem::u8path(htroot + path));
}
else {//Send the folder structure if it's enabled
string asd = Folder::folder(htroot + path);
Expand All @@ -341,7 +344,8 @@ class AlyssaHTTP {//This class has main code for responses to client
file.open(std::filesystem::u8path(htroot + path), std::ios::binary); filesize = std::filesystem::file_size(std::filesystem::u8path(htroot + path));
}
else if (fileExists(htroot + path + ".html")) { //If exact requested file doesn't exist, an HTML file would exists with such name
file.open(std::filesystem::u8path(htroot + path + ".html"), std::ios::binary); filesize = std::filesystem::file_size(std::filesystem::u8path(htroot + path + ".html"));
path += ".html";
file.open(std::filesystem::u8path(htroot + path), std::ios::binary); filesize = std::filesystem::file_size(std::filesystem::u8path(htroot + path));
}
} //If none is exist, don't open any file so server will return 404.
}
Expand Down

0 comments on commit 7b2df42

Please sign in to comment.