Skip to content

Conversation

@erunion
Copy link
Member

@erunion erunion commented May 19, 2022

🚥 Fix RM-4400

🧰 Changes

This fixes a problem with R httr snippets where headers are being improperly added to snippets:

library(httr)

url <- "https://dash.readme.com/api/v1/api-specification"

queryString <- list(
  perPage = "10"
  page = "1",
)

response <- VERB("GET", url, add_headers(x_readme-version = 'v3.0Authorization = 'Basic REDACTED'), query = queryString, content_type("application/octet-stream"), accept("application/json"))

content(response, "text")
  • Multiple headers aren't being separated with a comma
  • Header values aren't always being encased with a trailing apostrophe.
  • x- headers are being rewritten to x_.

🧬 QA & Testing

I tried getting a Docker integration up and running for R but ran into a bunch of issues with getting the httr package installed. I was able to get it running locally but running the whole suite there's a lot of other problems with R snippets (notably multipart/form-data) that I don't have the energy to address in this PR.

For now, here's what running the headers fixture looks like. Note that the x- headers are being properly sent and returned through the response from https://httpbin.org/headers:

Screen Shot 2022-05-19 at 10 24 10 AM

@erunion erunion added the bug Something isn't working label May 19, 2022
@erunion erunion requested review from a team, Dashron, domharrington and kanadgupta and removed request for a team May 19, 2022 17:31
@erunion erunion merged commit 4be2a98 into main May 19, 2022
@erunion erunion deleted the fix/r-snippets branch May 19, 2022 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants