diff --git a/PasteBin/Program.cs b/PasteBin/Program.cs
index adf01b8..f90ae1c 100644
--- a/PasteBin/Program.cs
+++ b/PasteBin/Program.cs
@@ -632,87 +632,10 @@ class Program
{
var html = File.ReadAllText("assets/archives.html");
var page = context.Request?.Query["page"].ToString();
+ context.Response.ContentType = "text/html";
+ await context.Response.WriteAsync(html);
+ return;
- bool loggedIn = await IsLoggedInAsync(context.Request.Cookies["token"]);
- if (loggedIn)
- {
- html = html.Replace("{html}", "dashboard");
- }
- else
- {
- html = html.Replace("{html}", "login sign up");
- }
-
- int pageNumber;
- if (!int.TryParse(page, out pageNumber) || pageNumber <= 0)
- {
- pageNumber = 1;
- }
- int pastesPerPage = 50;
- int skipCount = (pageNumber - 1) * pastesPerPage;
-
- using (var connection = new SqliteConnection("Data Source=pastes.sqlite"))
- {
- await connection.OpenAsync();
- var command = connection.CreateCommand();
- command.CommandText = $"SELECT * FROM pastes WHERE Visibility != 'Private' AND Visibility != 'Unlisted' ORDER BY UID DESC LIMIT {pastesPerPage} OFFSET {skipCount}";
- var reader = await command.ExecuteReaderAsync();
- string pastes = string.Empty;
- while (await reader.ReadAsync())
- {
- var paste = new Paste
- {
- Title = reader.GetString(1),
- UnixDate = long.Parse(reader.GetString(2)),
- Size = reader.GetString(3),
- Visibility = reader.GetString(4),
- Id = reader.GetString(5),
- };
-
- string title = paste.Title;
- if (paste.Visibility == "Private" || paste.Visibility == "Unlisted")
- {
- continue;
- }
- if (paste.Title == "" || string.IsNullOrEmpty(paste.Title))
- {
- title = $"Untitled {reader.GetString(0)}";
- }
- if (paste.Title.Length > 40)
- {
- title = paste.Title.Substring(0, 40) + "...";
- }
- var difference = GetTimeDifference(DateTimeOffset.FromUnixTimeSeconds(paste.UnixDate ?? 0), DateTimeOffset.FromUnixTimeSeconds(DateTimeOffset.Now.ToUnixTimeSeconds()));
- pastes += $"