mirror of
https://github.com/warp-tech/warpgate.git
synced 2024-09-20 06:46:17 +08:00
lint
This commit is contained in:
parent
0d7a5ad395
commit
8e677a46df
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue