summaryrefslogtreecommitdiff
path: root/Userland/Services/RequestServer/GeminiRequest.h
blob: 9039b83980481ff8e5ad30b131feb8ba853bd91f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Copyright (c) 2020, the SerenityOS developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/Badge.h>
#include <LibCore/Forward.h>
#include <LibGemini/Forward.h>
#include <RequestServer/Request.h>

namespace RequestServer {

class GeminiRequest final : public Request {
public:
    virtual ~GeminiRequest() override;
    static NonnullOwnPtr<GeminiRequest> create_with_job(Badge<GeminiProtocol>, ConnectionFromClient&, NonnullRefPtr<Gemini::Job>, NonnullOwnPtr<Core::Stream::File>&&);

    Gemini::Job const& job() const { return *m_job; }

    virtual URL url() const override { return m_job->url(); }

private:
    explicit GeminiRequest(ConnectionFromClient&, NonnullRefPtr<Gemini::Job>, NonnullOwnPtr<Core::Stream::File>&&);

    virtual void set_certificate(DeprecatedString certificate, DeprecatedString key) override;

    NonnullRefPtr<Gemini::Job> m_job;
};

}