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

fix(fetch): encode parameters in source URL #817

Merged
merged 6 commits into from
Jun 2, 2023

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Jun 2, 2023

🚥 Fixes #816

🧰 Changes

Per the issue in #816, we're not properly encoding certain characters in the file path before constructing the x-readme-source-url header. This fix properly encodes them.

🧬 QA & Testing

Do tests pass?

I also confirmed this with a test file like so in my Node REPL:

> encodeURI('https://github.com/readmeio/rdme/blob/d594bfc40869ed27e1e73fe61d8fd374323acdd1/__tests__/__fixtures__/📈 Dashboard & Metrics/openapi.json')
'https://github.com/readmeio/rdme/blob/d594bfc40869ed27e1e73fe61d8fd374323acdd1/__tests__/__fixtures__/%F0%9F%93%88%20Dashboard%20&%20Metrics/openapi.json'

@kanadgupta kanadgupta changed the title Fix/encode url in header fix(fetch): encode parameters in source URL Jun 2, 2023
@kanadgupta kanadgupta marked this pull request as ready for review June 2, 2023 20:19
@kanadgupta kanadgupta requested review from erunion and RyanGWU82 June 2, 2023 20:20
Copy link
Member

@erunion erunion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dang, what a find

@kanadgupta kanadgupta merged commit ff86384 into next Jun 2, 2023
@kanadgupta kanadgupta deleted the fix/encode-URL-in-header branch June 2, 2023 21:03
kanadgupta pushed a commit that referenced this pull request Jun 2, 2023
## [8.6.4-next.2](v8.6.4-next.1...v8.6.4-next.2) (2023-06-02)

### Bug Fixes

* **fetch:** encode parameters in source URL ([#817](#817)) ([ff86384](ff86384))

[skip ci]
@kanadgupta kanadgupta added bug Something isn't working command:docs Issues pertaining to the `docs`, `changelogs`, or `custompages` commands command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands labels Jun 5, 2023
kanadgupta pushed a commit that referenced this pull request Jun 5, 2023
## [8.6.4](v8.6.3...v8.6.4) (2023-06-05)

### Bug Fixes

* empty commit to trigger patch release ([71cf84b](71cf84b))
* **fetch:** encode parameters in source URL ([#817](#817)) ([ff86384](ff86384))
* **fetch:** stricter source URL type-checking ([#818](#818)) ([d082473](d082473))

[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working command:docs Issues pertaining to the `docs`, `changelogs`, or `custompages` commands command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"is not a legal HTTP header value" errors when syncing docs
3 participants