mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
add Autoindex
This commit is contained in:
20
includes/Autoindex.hpp
Normal file
20
includes/Autoindex.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef AUTOINDEX_HPP
|
||||
#define AUTOINDEX_HPP
|
||||
|
||||
#include "webserv.hpp"
|
||||
|
||||
class Autoindex
|
||||
{
|
||||
private:
|
||||
|
||||
public:
|
||||
Autoindex();
|
||||
static std::string getPage(std::string path, std::string host);
|
||||
static std::string getReference(std::string file, std::string dir, std::string host);
|
||||
~Autoindex();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -15,6 +15,7 @@ private:
|
||||
std::string _method;
|
||||
std::string _version;
|
||||
std::string _URI;
|
||||
std::string _host;
|
||||
std::string _query;
|
||||
std::string _fileToSend;
|
||||
std::map<std::string, std::string> _headerField;
|
||||
@@ -37,6 +38,10 @@ public:
|
||||
int isDir(std::string);
|
||||
void OpenResponsFile(const char *path);
|
||||
|
||||
std::string ltrim(std::string);
|
||||
std::string rtrim(std::string);
|
||||
std::string trim(std::string);
|
||||
|
||||
int parseStartLine(std::string);
|
||||
int parseHeaderfield(std::string);
|
||||
void printHeaderInfo(void);
|
||||
|
||||
@@ -31,7 +31,11 @@
|
||||
#include <sys/stat.h>
|
||||
#include <map>
|
||||
#include <fstream>
|
||||
#include <dirent.h>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include "Socket.hpp"
|
||||
#include "Autoindex.hpp"
|
||||
#include "Server.hpp"
|
||||
#include "Header.hpp"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user