core: Implement basic git integration
Missing streaming, so git's a bit confused, but works. Also easy to bypass. Although I doubt any mf at alibaba gon bypass it with his custom UA.
This commit is contained in:
1 parent
090a9fc35f
commit
5b35b675cb
6 files changed
+114
-82
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#include <pistache/http_headers.h>
|
||||
#include <pistache/net.h>
|
||||
|
||||
class GitProtocolHeader : public Pistache::Http::Header::Header {
|
||||
public:
|
||||
NAME("Git-Protocol");
|
||||
|
||||
GitProtocolHeader() = default;
|
||||
|
||||
void parse(const std::string& str) override {
|
||||
m_text = str;
|
||||
}
|
||||
|
||||
void write(std::ostream& os) const override {
|
||||
os << m_text;
|
||||
}
|
||||
|
||||
std::string text() const {
|
||||
return m_text;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_text = "";
|
||||
};
|
||||
Reference in new issue
Block a user