rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
131 stars 80 forks source link

libCurl HTTP handler doesn't handle redirects #674

Closed hadley closed 1 year ago

hadley commented 1 year ago

Because of

curl::handle_setopt(handle, followlocation = FALSE)

This is probably low-priority, but it caused a confusing error for me when attempting to publish to colarado.rstudio.com which has been renamed to colorado.posit.co

hadley commented 1 year ago

Need to resolve why deployApp("tests/testthat/shinyapp-appR", server = "shinyapps.io") errors when it's removed.

aronatkins commented 1 year ago

@hadley the redirect probably does not receive the necessary authentication information.

aronatkins commented 1 year ago

Second option: The payload may not be attached to the redirect.

hadley commented 1 year ago

The error happens in updateBundleStatus() which returns

> POST /v1/bundles/6903688/status HTTP/2

< HTTP/2 303 
< date: Wed, 01 Mar 2023 18:56:21 GMT
< content-type: text/html; charset=UTF-8
< content-length: 0
< location: https://api.shinyapps.io/v1/bundles/6903688
< server: TornadoServer/6.2

This possibly works by coincidence with redirects disabled, it appears to be a successful request.

I'm not sure why shinyapps.io returns a temporary redirect here, but if I instead send the request to /v1/bundles/6903688, I get a 500 server error.

hadley commented 1 year ago

Can remove these lines once redirects work automatically: https://github.com/rstudio/rsconnect/blob/5103b9088965d3a869f4bd1133aefef995ca5c9b/R/ide.R#L56-L67