rp_serve_resource_file (private)

 rp_serve_resource_file path

Defined in packages/acs-tcl/tcl/request-processor-procs.tcl

Serve the resource file if kernel parameter settings allow this.

Parameters:
path (required)

Partial Call Graph (max 5 caller/called nodes):
%3 rp_resources_filter rp_resources_filter (private) rp_serve_resource_file rp_serve_resource_file rp_resources_filter->rp_serve_resource_file ad_raise ad_raise (public) rp_serve_resource_file->ad_raise parameter::get parameter::get (public) rp_serve_resource_file->parameter::get rp_file_can_be_public_p rp_file_can_be_public_p (private) rp_serve_resource_file->rp_file_can_be_public_p security::csp::add_static_resource_header security::csp::add_static_resource_header (public) rp_serve_resource_file->security::csp::add_static_resource_header

Testcases:
No testcase defined.
Source code:
    if { ![rp_file_can_be_public_p $path] } {
        ad_raise notfound
    }
    set expireTime [parameter::get -package_id $::acs::kernel_id -parameter ResourcesExpireInterval -default 0]
    if {$expireTime != 0} {
        try {
            expr {int([ns_baseunit -time $expireTime])}
        } on ok {expireTime} {
        } on error {errorMsg} {
            ns_log error "rp_serve_resource_file: invalid expire time '$expireTime' specified"
            set expireTime 0
        }
        ns_setexpires $expireTime
    }
    set mime_type [ns_guesstype $path]
    ::security::csp::add_static_resource_header -mime_type $mime_type

    ns_returnfile 200 [ns_guesstype $path$path
    return filter_return
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: