Cookie string doesn't get parsed ok by Rook

Aperta
#39 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
r
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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")
Lingua principale
C
Stelle
252
Fork
87
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rstudio/httpuv

Tutte le issue di rstudio/httpuv

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.