-
Notifications
You must be signed in to change notification settings - Fork 343
fix: Strip trailing slash for connections #752
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
Conversation
Ensures that trailing slashes are stripped before saving to DB Ref: HDX-1612
🦋 Changeset detectedLatest commit: 3dadbbd 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 |
| // Make sure we don't save a trailing slash in the host | ||
| const normalizedData = { | ||
| ...data, | ||
| host: stripTrailingSlash(data.host), |
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.
Probably out of scope. I wonder if we should handle this on the API side to always remove the trailing slash before any update/insert operations since I suspect the clickhouse client would throw with the malformed host
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.
We definitely should also be handling this in the API, but it was a slippery slope exclusively making that solution. I'll add in the API side as well.
packages/app/src/utils.ts
Outdated
| if (!url) { | ||
| return ''; | ||
| } |
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.
maybe we shouldn't mutate the return value if its nullish. I'd imagine the caller should throw if host string is invalid?
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.
agree. this should throw instead of a valid type that will just fail later on.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Ensures that trailing slashes are stripped before saving to DB
Ref: HDX-1612