R/httpget_static.R

Defines functions httpget_testapp

httpget_testapp <- function(requri){
  #only GET
  res$checkmethod()

  #set cache value
  res$setcache("static")

  # Prevent path traversal attack via ..%2F..%2F..%2F
  testapp <- system.file('test', package = 'opencpu')
  path <- do.call(file.path, as.list(c(testapp, requri)))
  assert_subdir(path, testapp)
  res$sendfile(path)
}
jeroen/opencpu documentation built on Aug. 21, 2023, 12:09 p.m.