Benign cargo Download

info.rs

Rust test marker or harnessimports http::header
SHA-25604f3b705c4b958904e091b0621bb95aeb4c2d7d4d82d1d6c9c562541a4d70222

Evidence

imports http::header::HeaderName lines 1–6
1use http::header::{self, HeaderName};
2use server::Request;
3
4const X_FORWARDED_FOR: &[u8] = b"x-forwarded-for";
5const X_FORWARDED_HOST: &[u8] = b"x-forwarded-host";
6const X_FORWARDED_PROTO: &[u8] = b"x-f …
Network destination assigned from call lines 41–45
41:44… => if host.is_none() {
42 host = Some(val.trim());
43 },
44 _ => (),
45 …
English function-word token "the" lines 110–123
⋯4 lines
114 }
115
116 /// Scheme of the request.
117 ///
118 /// Scheme is resolved through the following headers, in this order:
119 ///
120 /// - Forwarded
121 /// - X-Forwarded-Proto
122 /// - Uri
123 #[inline] …
X-Forwarded-For proxy header lines 143–150
143:51… eaders, in this order:
144 ///
145 /// - Forwarded
146 /// - X-Forwarded-For
147 /// - peer name of opened socket
148 #[inline]
149 pub fn remote(&self) -> Option<&str> {
150 if let Some(ref r) = …
Loopback socket endpoint with explicit port lines 153–176
⋯5 lines
158}
159
160#[cfg(test)]
161mod tests {
162 use super::*;
163 use test::TestRequest;
164
165 #[test]
166 fn test_forwarded() {
167 let req = TestRequest::default().request();
168 let mut info = ConnectionInfo::default();
169 info.update(&req);
170 assert_eq!(info.scheme(), "http");
171 assert_eq!(info.host(), "localhost:8080");
172
173 let req = TestRequest::default()
174 .header(
175 header::FORWARDED,
176 "for= …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.