Description
What is the current behavior?
there are several places in the code where path.join
is used in the creation of a URL. Unfortunately, on windows the path separator is ``` and that produces invalid URLs. While we may not intend the service to actually run on Windows, community members seeking to contribute and working on Windows will want to run the tests which expect valid URLs.
See the following for specific examples. There may well be more.
- https://github.com/github/docs/blob/main/middleware/archived-enterprise-versions.js#L72
- https://github.com/github/docs/blob/main/middleware/archived-enterprise-versions.js#L100
Unfortunately there are lots of legit uses of path.join
so a simple search for that pattern is pretty noisy. I don't have a good enough handle on the codebase to easily identify which parts are likely to construct URLs.
Would be super interesting to have a CodeQL query that detects the use of path.join
to create value that's eventually returned in a header or some such.
What changes are you suggesting?
cc: @github/docs-engineering