headers: add csrf (#35)

This commit is contained in:
Vaxry
2025-06-15 17:21:23 +02:00
committed by GitHub
parent b606a21912
commit 7c3bb4cbd9
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#include <pistache/http_headers.h>
#include <pistache/net.h>
class XCSRFTokenHeader : public Pistache::Http::Header::Header {
public:
NAME("X-Csrf-Token");
XCSRFTokenHeader() = default;
void parse(const std::string& str) override {
m_data = str;
}
void write(std::ostream& os) const override {
os << m_data;
}
std::string ip() const {
return m_data;
}
private:
std::string m_data = "";
};