_acs-tcl__log_user_agent (private)
_acs-tcl__log_user_agent
Defined in packages/acs-tcl/tcl/test/utilities-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ foreach raw [list {} {Browser plain} {plus+ percent% literal%20} {\x0a\n\u0000} {Browser Österreich 日本} {[error unevaluated] $unevaluated} "Agent \"quoted\" \\literal\n\r\t\x7f"] { set formatted [util::log_user_agent $raw] aa_true "Encoded value has an explicit nontruncated flag" [regexp {^([^ \t\r\n]*) user_agent_truncated 0$} $formatted -> encoded] aa_equals "Default-charset URL encoding round trip" [ns_urldecode -- $encoded] $raw aa_equals "Uses the default URL encoding" $encoded [ns_urlencode -- $raw] } aa_equals "Empty header" [util::log_user_agent {}] { user_agent_truncated 0} set full [util::log_user_agent [string repeat x 1024]] aa_true "Exact bound is not truncated" [string match {*user_agent_truncated 0} $full] set clipped [util::log_user_agent [string repeat 日 1025]] regexp {^([^ ]*)} $clipped -> encoded aa_equals "Bound is applied before URL encoding" [ns_urldecode -- $encoded] [string repeat 日 1024] aa_true "Truncation is explicit" [string match {*user_agent_truncated 1} $clipped] }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "log_user_agent (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle