Add origin/host validation and warning for exposed serves (#1270)

This commit is contained in:
boatbomber 2026-06-07 15:51:05 -07:00 • committed by GitHub
parent 444dc11b26
commit ac6941f054
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 852 additions and 11 deletions

View file

@ -290,6 +290,13 @@ impl ErrorResponse {
}
}
pub fn forbidden<S: Into<String>>(details: S) -> Self {
Self {
kind: ErrorResponseKind::Forbidden,
details: details.into(),
}
}
pub fn internal_error<S: Into<String>>(details: S) -> Self {
Self {
kind: ErrorResponseKind::InternalError,
@ -302,5 +309,6 @@ impl ErrorResponse {
pub enum ErrorResponseKind {
NotFound,
BadRequest,
Forbidden,
InternalError,
}