path_is_safe_for_cran: Test if path matches repository directory structure

View source: R/handlers-static.R

path_is_safe_for_cranR Documentation

Test if path matches repository directory structure

Description

Tests if the requested resource maps to a safe path in the respository, i.e., that it points to '/src/contrib', '/bin/windows/contrib' or '/bin/macosx/contrib', and does not attempt to weasle back out with '..'.

Usage

path_is_safe_for_cran(s)

Arguments

s

The path to check, typically 'req$PATH_INFO' in a request handler.

Value

Logical


microCRAN documentation built on Nov. 4, 2023, 1:07 a.m.