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: skip external URLs in withBase #328

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

zouhangwithsweet
Copy link
Contributor

@zouhangwithsweet zouhangwithsweet commented Jun 30, 2021

Reason

I found that withBase will add path for all path, if I want to use some web resource. It's no need. So I add some path check for some url

More

I have no idea for that there is necessary to check all path which is been wrapped withBase.

@posva
Copy link
Member

posva commented Jun 30, 2021

Maybe is worth for withBase to skip paths that start with http.

BTW, in a regex you can write c? instead of c{0,1}

@kiaking
Copy link
Member

kiaking commented Jun 30, 2021

Yeah I also think withBase skipping URL starting with https?:// sounds a better idea 👀 I wouldn't think it will break anything, if anything, it's breaking URLs for people so 😅

@kiaking kiaking added the enhancement New feature or request label Jun 30, 2021
@zouhangwithsweet
Copy link
Contributor Author

Maybe is worth for withBase to skip paths that start with http.

BTW, in a regex you can write c? instead of c{0,1}

OK, sir

@zouhangwithsweet
Copy link
Contributor Author

Yeah I also think withBase skipping URL starting with https?:// sounds a better idea 👀 I wouldn't think it will break anything, if anything, it's breaking URLs for people so 😅

I will make changes according to your suggestions. :)

@zouhangwithsweet zouhangwithsweet force-pushed the fix_remove_uselesspathbase branch 2 times, most recently from 02ecd56 to b2d4570 Compare July 1, 2021 03:00
@zouhangwithsweet zouhangwithsweet changed the title fix: remove useless path base for web resource feat: remove useless path base for web resource Jul 1, 2021
@kiaking kiaking requested a review from posva July 1, 2021 03:04
src/client/app/utils.ts Outdated Show resolved Hide resolved
@posva
Copy link
Member

posva commented Jul 1, 2021

@kiaking I think we should move the RE in a shared file. I saw multiple occurrences of it across the codebase

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

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

Thanks!

@posva posva changed the title feat: remove useless path base for web resource fix: skip external URLs in withBase Jul 2, 2021
@posva posva merged commit 53bb961 into vuejs:master Jul 2, 2021
YunYouJun pushed a commit to YunYouJun/vitepress that referenced this pull request Aug 30, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants