Skip to content

Commit

Permalink
Use the req$pr instead of self in case code is moved else where
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke committed Oct 5, 2022
1 parent 885c598 commit 387a041
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions R/plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ Plumber <- R6Class(
if (!grepl("/$", path)) {
new_path <- paste0(path, "/")
# and a route with a slash exists...
if (router_has_route(self, new_path, req$REQUEST_METHOD)) {
if (router_has_route(req$pr, new_path, req$REQUEST_METHOD)) {

# Temp redirect with same REQUEST_METHOD
# Add on the query string manually. They do not auto transfer
Expand All @@ -608,7 +608,6 @@ Plumber <- R6Class(

# No trailing-slash route exists...
# Try allowed verbs

if (isTRUE(getOption("plumber.methodNotAllowed", TRUE))) {
# Notify about allowed verbs
if (is_405(req$pr, req$PATH_INFO, req$REQUEST_METHOD)) {
Expand Down

0 comments on commit 387a041

Please sign in to comment.