-
Notifications
You must be signed in to change notification settings - Fork 191
fix: enable path parsing to account for root level paths #1638
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: aa943dc The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for the pull request @LukeHagar , we'll take a look. |
|
@LukeHagar do you mind adding a simple e2e test for the case? |
|
I'd be happy too, I realize this solution would also collide with any API endpoints that are actually |
|
@lornajane @tatomyr I think this is right. I couldn't get any of the tests to run locally due to a warning about an outdated dep messing with the snapshot output |
It's most likely because you're using Node version 21 or higher. If you try version 20 or earlier, it should work locally. |
|
Yup I'm on |
|
|
||
| export function pathToFilename(path: string, pathSeparator: string) { | ||
| if (path === '/') { | ||
| return '~root'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that it will create a file named ~root for the root path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the best solution here would be simply returning the pathSeparator.
@LukeHagar, let me know if are still interested in the PR, or I'll redo this myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swapped it over, but I do think there could be a better solution here, as a root level endpoint is somewhat common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be right, but I haven't come up with a better solution yet. Let's start small and will see how it goes.
|
Could you rebase your branch as I believe smoke tests are failing due to the outdated code? |
|
I'll rebase when I get on this morning |
|
@LukeHagar it looks like it's too much to rebase. As for me, it'd be simpler to reapply your changes from scratch. |
|
Any updates @LukeHagar 🙂? |
What/Why/How?
Fixes #1634
Reference
Testing
Screenshots (optional)
Check yourself
Security