Validating Host headers in RPC requests (#1658)

* Validating Host headers in RPC requests

* Fixing convention [ci skip]

* Remove extra indent.

[ci:skip]
This commit is contained in:
Tomasz Drwięga
2016-07-19 12:53:58 +02:00
committed by Gav Wood
parent 615fca5dc5
commit 6e79a36ef6
11 changed files with 176 additions and 60 deletions

View File

@@ -38,6 +38,15 @@ impl ContentHandler {
}
}
pub fn forbidden(content: String, mimetype: String) -> Self {
ContentHandler {
code: StatusCode::Forbidden,
content: content,
mimetype: mimetype,
write_pos: 0
}
}
pub fn not_found(content: String, mimetype: String) -> Self {
ContentHandler {
code: StatusCode::NotFound,