This commit is contained in:
Eugene Pankov 2023-06-02 09:26:52 +02:00
parent 0d7a5ad395
commit 8e677a46df
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
4 changed files with 8 additions and 14 deletions

View file

@ -19,19 +19,14 @@ pub enum AsciiCast {
Output(f32, String, String),
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Default)]
pub enum TerminalRecordingStreamId {
Input,
#[default]
Output,
Error,
}
impl Default for TerminalRecordingStreamId {
fn default() -> Self {
TerminalRecordingStreamId::Output
}
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum TerminalRecordingItem {

View file

@ -207,10 +207,9 @@ fn copy_server_request<B: SomeRequestBuilder>(req: &Request, mut target: B) -> B
fn inject_forwarding_headers<B: SomeRequestBuilder>(req: &Request, mut target: B) -> Result<B> {
if let Some(host) = req.headers().get(http::header::HOST) {
target = target.header(
X_FORWARDED_HOST.clone(),
host.to_str()?.split(':').next().unwrap().to_string(),
);
if let Some(host) = host.to_str()?.split(':').next() {
target = target.header(X_FORWARDED_HOST.clone(), host.to_string());
}
}
target = target.header(X_FORWARDED_PROTO.clone(), req.scheme().as_str().to_owned());
if let Some(addr) = req.remote_addr().as_socket_addr() {

View file

@ -6,7 +6,7 @@ import { Alert, FormGroup } from 'sveltestrap'
let error: Error|null = null
let name = ''
let type: 'Ssh'|'MySql'|'Http' = 'Ssh'
let type: 'Http' | 'MySql' | 'Ssh' = 'Ssh'
async function create () {
if (!name || !type) {

View file

@ -17,7 +17,7 @@
let seekInputValue = 0
let duration = 0
let resizeObserver: ResizeObserver|undefined
let events: (SizeEvent | DataEvent | SnapshotEvent)[] = []
let events: (DataEvent | SizeEvent | SnapshotEvent)[] = []
let playing = false
let loading = true
let sessionIsLive: boolean|null = null
@ -67,7 +67,7 @@
}
// eslint-disable-next-line @typescript-eslint/no-type-alias
type AsciiCastData = [number, 'o', string]
type AsciiCastItem = AsciiCastHeader | AsciiCastData
type AsciiCastItem = AsciiCastData | AsciiCastHeader
function isAsciiCastHeader (data: AsciiCastItem): data is AsciiCastHeader {
return 'version' in data