Skip to content

Commit 3911ac9

Browse files
fix: fill out content type and content length in discovery
1 parent ed43410 commit 3911ac9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

postmaster/instantiations/HttpPageDiscovery.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@ namespace application
4242
device.Add("attributes", postmaster.attributes);
4343
});
4444
}
45+
46+
infra::BoundedConstString HttpPageDiscovery::ContentType() const
47+
{
48+
return "application/json";
49+
}
4550
}

postmaster/instantiations/HttpPageDiscovery.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ namespace application
1414
HttpPageDiscovery(infra::BoundedConstString path, application::PostmasterDiscovery& discovery);
1515

1616
// Implementation of SimpleHttpPage
17-
virtual bool ServesRequest(const infra::Tokenizer& pathTokens) const override;
18-
virtual void RespondToRequest(services::HttpRequestParser& parser, services::HttpServerConnection& connection) override;
17+
bool ServesRequest(const infra::Tokenizer& pathTokens) const override;
18+
void RespondToRequest(services::HttpRequestParser& parser, services::HttpServerConnection& connection) override;
1919

2020
// Implementation of HttpResponse
21-
virtual infra::BoundedConstString Status() const override;
22-
virtual void WriteBody(infra::TextOutputStream& stream) const override;
21+
infra::BoundedConstString Status() const override;
22+
void WriteBody(infra::TextOutputStream& stream) const override;
23+
infra::BoundedConstString ContentType() const override;
2324

2425
private:
2526
infra::BoundedConstString path;

0 commit comments

Comments
 (0)