remove duplicate code from net folder

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-07-07 02:49:27 +03:00
parent 330c95e55b
commit c07260e836
28 changed files with 72 additions and 189 deletions

View File

@ -4,6 +4,7 @@
* Copyright (c) 2022 flowln <flowlnlnln@gmail.com>
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
* Copyright (C) 2023 Rachel Powers <508861+Ryex@users.noreply.github.com>
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,7 +28,7 @@ namespace Net {
class RawHeaderProxy : public HeaderProxy {
public:
RawHeaderProxy() : HeaderProxy() {}
RawHeaderProxy(QList<HeaderPair> headers = {}) : HeaderProxy(), m_headers(headers) {};
virtual ~RawHeaderProxy() = default;
public:
@ -36,6 +37,7 @@ class RawHeaderProxy : public HeaderProxy {
void addHeader(const HeaderPair& header) { m_headers.append(header); }
void addHeader(const QByteArray& headerName, const QByteArray& headerValue) { m_headers.append({ headerName, headerValue }); }
void addHeaders(const QList<HeaderPair>& headers) { m_headers.append(headers); }
void setHeaders(QList<HeaderPair> headers) { m_headers = headers; };
private:
QList<HeaderPair> m_headers;