Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly encode URLs passed to github contents endpoint
- This fixes a bug where a URL could come in with 2 '?'. We'd pass that down to the github API, and it would be ignored by the API. Then, the API would return a different return type that expected in rendered_markdown_from_github. - Now these URLs will return a 404 because the requested guide can not be found. In addition, this will allow us to support guides with special URL characters in them now like '?'. - To reproduce and test see below. - For example, request this URL: - /front-end-javascript/introduction-to-test-driven-development-in-javascript?status=in-review?branch=adityavarshney - This would result in us passing the following 'path' to the github contents API: - repos/durden/articles/contents/in-review?branch=adityavarshney/front-end-javascript/introduction-to-test-driven-development-in-javascript/article.md - This would in turn return the contents of the contents/in-review/ directory, not a single file. This would finally result in a TypeError because the response was not text, but a list of values for each file in the directory.
- Loading branch information