Cookie string doesn't get parsed ok by Rook

Abierto
#39 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
r
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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")
Lenguaje dominante
C
Estrellas
252
Forks
87
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rstudio/httpuv

Todos los issues de rstudio/httpuv

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.