Skip to content

Commit d056f04

Browse files
authored
Canonicalize unknown. (#69)
1 parent b74b362 commit d056f04

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/plugin/plugin_pdo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl FromStr for Dsn {
291291
"oci" => "1521", // Oracle
292292
"sqlsrv" => "1433",
293293
"pgsql" => "5432",
294-
_ => "unknown",
294+
_ => "0",
295295
};
296296

297297
let ss = data_source.split(';');

src/request.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ fn get_page_request_url(server: &ZArr) -> crate::Result<Url> {
116116
.and_then(z_val_to_string)
117117
.map(|port| format!("localhost:{}", port))
118118
})
119-
.unwrap_or_else(|| "UNKNOWN".to_string());
119+
.unwrap_or_else(|| "unknown:0".to_string());
120120

121121
let uri = server
122122
.get("REQUEST_URI")
123123
.and_then(z_val_to_string)
124124
.or_else(|| server.get("PHP_SELF").and_then(z_val_to_string))
125125
.or_else(|| server.get("SCRIPT_NAME").and_then(z_val_to_string))
126-
.unwrap_or_else(|| "/UNKNOWN".to_string());
126+
.unwrap_or_else(|| "/unknown".to_string());
127127

128128
Ok(Url::parse(&format!("{}://{}{}", scheme, addr, uri))?)
129129
}
@@ -256,12 +256,12 @@ fn get_swoole_request_url(server: &ZArr, headers: &ZArr) -> crate::Result<Url> {
256256
.and_then(z_val_to_string)
257257
.map(|port| format!("localhost:{}", port))
258258
})
259-
.unwrap_or_else(|| "UNKNOWN".to_string());
259+
.unwrap_or_else(|| "unknown:0".to_string());
260260

261261
let uri = server
262262
.get("request_uri")
263263
.and_then(z_val_to_string)
264-
.unwrap_or_else(|| "/UNKNOWN".to_string());
264+
.unwrap_or_else(|| "/unknown".to_string());
265265

266266
let query = server
267267
.get("query_string")

0 commit comments

Comments
 (0)