security::debug_return_url_signature
security::debug_return_url_signature
Defined in
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
-
No testcase defined.
Source code:
catch {
if {![nsv_get security_return_url_signature_debug settings settings]
|| ![dict exists $settings until]
|| ![string is integer -strict [dict get $settings until]]
|| [dict get $settings until] <= [clock seconds]
|| ![ns_conn isconnected]} {
return
}
set path /storage/download-zip
if {[dict exists $settings path]} {
set path [dict get $settings path]
}
if {$path eq ""} {
return
}
set source [ns_conn url]
set malformed_p [expr {$stage eq "malformed"}]
if {$source ne $path && [string first $path $url] < 0
&& !(($stage eq "export-url" || $stage eq "export-form")
&& [string first "[file dirname $path]/" $source] == 0)} {
return
}
set peer [ns_conn peeraddr]
if {!$malformed_p && [dict exists $settings peer]
&& [dict get $settings peer] ne ""
&& [dict get $settings peer] ne $peer} {
return
}
set headers [ns_conn headers]
set record [list SIGNATURE-PROBE stage $stage driver [ns_conn driver] peer $peer]
foreach {field text limit} [list request [ns_conn request] 4096 url $url 4096 signature $signature 256 referrer [ns_set iget $headers referer] 1024 user_agent [ns_set iget $headers user-agent] 512] {
set truncated [expr {[string length $text] > $limit}]
if {$truncated} {
set text [string range $text 0 $limit-1]
}
lappend record ${field}_urlencoded [ns_urlencode -- $text] ${field}_truncated $truncated
}
ns_log notice $record
}
return
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]