thomasp85 / fiery

A flexible and lightweight web server
https://fiery.data-imaginist.com
Other
240 stars 12 forks source link

RStudio crashes when on("request") doesn't return the expected HTTP response list #4

Closed daattali closed 7 years ago

daattali commented 7 years ago

Consider the following simple GET listener

library(fiery)
app <- Fire$new()
app$port <- 9000
app$host <- "127.0.0.1"

app$on('request', function(server, id, request, ...) {
  if (request$REQUEST_METHOD == "GET") {
    list(
      status = 200L,
      headers = list('Content-Type' = 'text/html'),
      body = paste('Get it!')
    )
  }
})

app$start(block = FALSE)

If you ping this URL with any request that is not a GET, my RStudio crashes. I'm on Windows 7.

thomasp85 commented 7 years ago

Have you installed the latest from GitHub. It should default to a 404 response... Will check it out later

daattali commented 7 years ago

Sorry, no I haven't, I definitely should have tried that before submitting a bug. I'll check right now


http://deanattali.com

On 9 August 2016 at 00:27, Thomas Lin Pedersen notifications@github.com wrote:

Have you installed the latest from GitHub. It should default to a 404 response... Will check it out later

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomasp85/fiery/issues/4#issuecomment-238475034, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6IFF_ySJ0kQYnz-bDpw_bZC7iCiNg5ks5qeCvjgaJpZM4JfyXm .

daattali commented 7 years ago

Just installed latest version from github v0.2.2 , still crashing


http://deanattali.com

On 9 August 2016 at 00:28, Dean Attali daattali@gmail.com wrote:

Sorry, no I haven't, I definitely should have tried that before submitting a bug. I'll check right now


http://deanattali.com

On 9 August 2016 at 00:27, Thomas Lin Pedersen notifications@github.com wrote:

Have you installed the latest from GitHub. It should default to a 404 response... Will check it out later

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomasp85/fiery/issues/4#issuecomment-238475034, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6IFF_ySJ0kQYnz-bDpw_bZC7iCiNg5ks5qeCvjgaJpZM4JfyXm .

thomasp85 commented 7 years ago

Ok, I'll look into it