Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing httpbin methods #3

Closed
17 tasks done
gaborcsardi opened this issue Apr 7, 2020 · 7 comments
Closed
17 tasks done

Missing httpbin methods #3

gaborcsardi opened this issue Apr 7, 2020 · 7 comments
Labels
feature a feature request or enhancement

Comments

@gaborcsardi
Copy link
Member

gaborcsardi commented Apr 7, 2020

  • /digest-auth
  • /hidden-basic-auth
  • /cache
  • /cache/{value}
  • /etag
  • /response-headers
  • /brotli
  • /deflate
  • /drip
  • /links/{n}{offset}
  • /range/{numbytes}
  • /stream-bytes/{n}
  • /stream/{n}
  • /cookies
  • /cookies/delete
  • /cookies/set
  • /cookies/set/{name}/{value}
@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Oct 12, 2020
@juliasilge
Copy link
Member

I use /cache and /etag in the tests for pins and would love to switch over to using webfakes in these cases.

@gaborcsardi
Copy link
Member Author

@juliasilge can you please try if it works for you now?

@juliasilge
Copy link
Member

The regular /cache and /etag work great for me, but the cache control like /cache/60 (cacheable for 60 sec, for example) does not behave how I was expecting:

library(webfakes)

httpbin <- local_app_process(httpbin_app())
url1 <- httpbin$url("/cache/60")
resp1 <- httr::GET(url1)
httr::cache_info(resp1)
#> <cache_info>  http://127.0.0.1:52399/cache/60
#>   Cacheable:     TRUE
#> Error in http_date(x$expires): inherits(x, "POSIXt") is not TRUE

url2 <- "https://httpbin.org/cache/60"
resp2 <- httr::GET(url2)
httr::cache_info(resp2)
#> <cache_info>  https://httpbin.org/cache/60
#>   Cacheable:     TRUE
#>   Expires:       Tue, 09 May 2023 16:37:26 GMT
#>   Last-Modified: 
#>   Etag:

Created on 2023-05-09 with reprex v2.0.2

@gaborcsardi
Copy link
Member Author

gaborcsardi commented May 9, 2023

Right! Should be good now. Thanks for checking!

@juliasilge
Copy link
Member

Is it possible something has gone awry with timezones?

library(webfakes)

httpbin <- local_app_process(httpbin_app())
url1 <- httpbin$url("/cache/60")
resp1 <- httr::GET(url1)
cache1 <- httr::cache_info(resp1)
cache1$expires
#> [1] "2023-05-09 11:51:04 GMT"

url2 <- "https://httpbin.org/cache/60"
resp2 <- httr::GET(url2)
cache2 <- httr::cache_info(resp2)
cache2$expires
#> [1] "2023-05-09 17:51:06 GMT"

Created on 2023-05-09 with reprex v2.0.2

When I ran this, 11:50 or so was my local time in US Mountain Time, not GMT.

@gaborcsardi
Copy link
Member Author

Ah, yes. Hopefully it is good now.

@juliasilge
Copy link
Member

This works great now, and the pins CI is so much less painful! Thank you so much! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants