rejectMissingMethods results in an error

Đang mở
#86 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
r
Lĩnh vực
api

Hướng nghiên cứu

Start by reproducing the issue with rejectMissingMethods enabled, the GET / request to /post_only, and the logger output showing the missing FUN.VALUE argument. Trace the missing-method route handling and error response path; done means the same request returns HTTP 405 instead of HTTP 500 while the option remains enabled.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I'm finding that if I enable rejectMissingMethods, it returns an error 500 instead of a 405:

options(plumber2.rejectMissingMethods = TRUE)

#' @plumber
function(api) {
    plumber2::api_logger(api, logger = plumber2::logger_console())
}

#' @get /
function() {
    1L
}

#' @post /post_only
function() {
    1L
}

Requesting the POST-only route with GET:

> curl -i http://127.0.0.1:8080/post_only 
HTTP/1.1 500 Internal Server Error
Date: Wed, 06 May 2026 07:35:15 GMT
content-type: text/plain
date: Wed, 06 May 2026 07:35:15 GMT
set-cookie: fiery_id=4ae8b6abdd745a588bebb8c10f9df8ae959f565c040419d57487b9cce953f40c; HttpOnly; Path=/; SameSite=Strict
Content-Length: 21

Internal Server Error%                                                                                             

Where the logger outputs

2026-05-06 17:35:15.012286 - error: argument "FUN.VALUE" is missing, with no default

Disabling the option avoids the internal error.

Ngôn ngữ chính
R
Star
119
Fork
17
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của posit-dev/plumber2

Tất cả issue của posit-dev/plumber2

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.