Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions lib/vey-ftp-client/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ impl FtpServerFeature {
"utf8" => self.utf8_path = true,
"size" => self.file_size = true,
"mdtm" => self.file_mtime = true,
"rest" => {
if v.to_lowercase().eq("stream") {
self.rest_stream = true;
}
"rest" if v.to_lowercase().eq("stream") => {
self.rest_stream = true;
}
"pret" => self.pre_transfer = true,
"mlst" => self.machine_list = true,
Expand Down
6 changes: 2 additions & 4 deletions lib/vey-http/src/server/adaptation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ impl HttpAdaptedRequest {
// this will always be chunked encoding
return Ok(());
}
"via" => {
if ignore_via {
return Ok(());
}
"via" if ignore_via => {
return Ok(());
}
_ => {}
}
Expand Down
6 changes: 2 additions & 4 deletions lib/vey-http/src/server/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,8 @@ impl HttpProxyClientRequest {
self.has_content_length = true;
self.content_length = content_length;
}
"expect" => {
if header.value == "100-continue" {
self.expect_100_continue = true;
}
"expect" if header.value == "100-continue" => {
self.expect_100_continue = true;
}
_ => {}
}
Expand Down
12 changes: 4 additions & 8 deletions lib/vey-http/src/server/transparent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,11 @@ impl HttpTransparentRequest {
"te" | "proxy-authorization" => {
return self.insert_hop_by_hop_header(name, &header);
}
"forwarded" | "x-forwarded-for" => {
if self.steal_forwarded_for {
return Ok(());
}
"forwarded" | "x-forwarded-for" if self.steal_forwarded_for => {
return Ok(());
}
"expect" => {
if header.value == "100-continue" {
self.expect_100_continue = true;
}
"expect" if header.value == "100-continue" => {
self.expect_100_continue = true;
}
_ => {}
}
Expand Down
20 changes: 7 additions & 13 deletions lib/vey-resolver/src/driver/hickory/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,15 @@ impl HickoryClientJob {
for r in msg.take_answers() {
ttl = r.ttl();
match r.data() {
RData::A(v) => {
if req.rtype == RecordType::A {
ips.push(IpAddr::V4(v.0));
}
RData::A(v) if req.rtype == RecordType::A => {
ips.push(IpAddr::V4(v.0));
}
RData::AAAA(v) => {
if req.rtype == RecordType::AAAA {
ips.push(IpAddr::V6(v.0))
}
RData::AAAA(v) if req.rtype == RecordType::AAAA => {
ips.push(IpAddr::V6(v.0))
}
RData::CNAME(v) => {
if name.eq(r.name()) {
has_cname = true;
name = v.0.clone();
}
RData::CNAME(v) if name.eq(r.name()) => {
has_cname = true;
name = v.0.clone();
}
_ => {}
}
Expand Down
6 changes: 2 additions & 4 deletions vey-keyless/src/protocol/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,8 @@ impl KeylessRequest {

fn check_payload_for_key_size(&self, key_size: usize) -> Result<(), KeylessErrorResponse> {
match self.opcode {
0x01 | 0x08 => {
if self.payload.len() != key_size {
return Err(KeylessErrorResponse::new(self.id).format_error());
}
0x01 | 0x08 if self.payload.len() != key_size => {
return Err(KeylessErrorResponse::new(self.id).format_error());
}
_ => {}
}
Expand Down
18 changes: 5 additions & 13 deletions vey-proxy/src/inspect/imap/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,13 @@ impl Capability {
b"LIST-EXTENDED" => {} // rfc5258, rev2
b"LIST-STATUS" => {} // rfc5819, rev2
b"CREATE-SPECIAL-USE" | b"SPECIAL-USE" => {} // rfc6154, rev2
b"LITERAL+" => {
// rfc7888
if !self.has_non_sync_literal {
self.has_non_sync_literal = true;
} else {
return None;
};
b"LITERAL+" if !self.has_non_sync_literal => {
// // rfc7888
self.has_non_sync_literal = true;
}
b"LITERAL-" => {
b"LITERAL-" if !self.has_non_sync_literal => {
// rfc7888, rev2
if !self.has_non_sync_literal {
self.has_non_sync_literal = true;
} else {
return None;
}
self.has_non_sync_literal = true;
}
b"BINARY" => {} // rfc3516, partially merged into rev2
b"CONVERT" => {} // rfc5259, require "BINARY"
Expand Down
6 changes: 2 additions & 4 deletions vey-proxy/src/serve/http_proxy/task/protocol/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ where
// proxy-connection is not standard, but at least curl use it
return req.parse_header_connection(header);
}
"forwarded" | "x-forwarded-for" => {
if config.steal_forwarded_for {
return Ok(());
}
"forwarded" | "x-forwarded-for" if config.steal_forwarded_for => {
return Ok(());
}
_ => {}
}
Expand Down
Loading