Cookie string doesn't get parsed ok by Rook

Đang mở
#39 2 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
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
r
Lĩnh vực
backend

Hướng nghiên cứu

Start by reproducing the provided app with httpuv::runServer and compare its cookie behavior with Rook::Rhttpd$new(). Focus on the interaction between Request$cookies() and req$HTTP_COOKIE; done means newly set cookies are recognized after refreshing under runServer, matching the working Rhttpd path.

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

Mô tả

This seems to be a Rook/httpuv interaction. Using Rook::Rhttpd, things work OK. For me: new cookies are not recognized by Rook::Request$cookies() when I refresh, even though they are visible in the HTTP_COOKIE element of the environment.

R 3.1.1, Rook 1.1.1, httpuv 1.3.2.

Test case:

library(httpuv)
library(Rook)
ctr <- 1
app <- list(call=function(req) {
  rr <- Request$new(req)
  res <- Response$new()
  res$set_cookie(paste0("foo", ctr), paste0("bar", ctr))
  res$write("<html><body><p>Hit refresh to see the name of the cookie I just set... it should be: foo")
  res$write(ctr)
  res$write("</p>")
  ctr <<- ctr + sample(1:1000, 1)

  res$write("<p>Cookie names seen by rr$cookies():</p>")
  res$write(paste(names(rr$cookies()), collapse="<br>"))
  res$write("<p>cookie string from request env:</p>")
  res$write(req$HTTP_COOKIE)
  res$write("</body></html>")

  return(res$finish())
})
# won't work:
runServer("127.0.0.1", 4444, app)
# works:
rh <- Rhttpd$new()
rh$launch(app$call, "cookie")
Ngôn ngữ chính
C
Star
252
Fork
87
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

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 rstudio/httpuv

Tất cả issue của rstudio/httpuv

Issue tương tự

Thêm issue về C

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.