wip: implementing message handler, finished to implement request manipulation
This commit is contained in:
parent
a9ce26ae76
commit
c4cf40be4e
13 changed files with 834 additions and 182 deletions
|
|
@ -18,6 +18,13 @@ pub enum HttpError {
|
|||
NoMatchingBackendApp,
|
||||
#[error("Failed to redirect: {0}")]
|
||||
FailedToRedirect(String),
|
||||
#[error("No upstream candidates")]
|
||||
NoUpstreamCandidates,
|
||||
#[error("Failed to generate upstream request: {0}")]
|
||||
FailedToGenerateUpstreamRequest(String),
|
||||
|
||||
#[error("Failed to add set-cookie header in response")]
|
||||
FailedToAddSetCookeInResponse,
|
||||
|
||||
#[error(transparent)]
|
||||
Other(#[from] anyhow::Error),
|
||||
|
|
@ -30,6 +37,10 @@ impl From<HttpError> for StatusCode {
|
|||
HttpError::InvalidHostInRequestHeader => StatusCode::BAD_REQUEST,
|
||||
HttpError::SniHostInconsistency => StatusCode::MISDIRECTED_REQUEST,
|
||||
HttpError::NoMatchingBackendApp => StatusCode::SERVICE_UNAVAILABLE,
|
||||
HttpError::FailedToRedirect(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
HttpError::NoUpstreamCandidates => StatusCode::NOT_FOUND,
|
||||
HttpError::FailedToGenerateUpstreamRequest(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
HttpError::FailedToAddSetCookeInResponse => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
_ => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue