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

feat: reorganize the network plugin structure #3

Merged
merged 16 commits into from
May 31, 2023
Merged

Conversation

wqcstrong
Copy link
Collaborator

No description provided.

src/plugins/network/proxy/base.ts Outdated Show resolved Hide resolved
src/plugins/network/proxy/base.ts Outdated Show resolved Hide resolved
src/plugins/network/proxy/base.ts Outdated Show resolved Hide resolved
BREAKING CHANGE: transform headers/getData to [string, string][], and postData to [string, string][] | string
Comment on lines 44 to 54
// https://exp.com => "exp.com"
// https://exp.com/ => "exp.com"
// https://exp.com/devtools => "devtools"
// https://exp.com/devtools/ => "devtools"
// https://exp.com/devtools?version=Mac/10.15.7 => "devtools?version=Mac/10.15.7"
// https://exp.com/devtools/?version=Mac/10.15.7 => "devtools?version=Mac/10.15.7"
let name = pathname.replace(/[/]*$/, '').split('/').pop() || '';
name += search;
if (name === '') {
name = hostname;
}
Copy link
Collaborator Author

@wqcstrong wqcstrong May 27, 2023

Choose a reason for hiding this comment

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

I have tried using regular expression to extract the "last path", but for the sake of code readability, I finally keep the previous implementation. Do you have greater idea? @YanagiEiichi

src/plugins/network/proxy/xhr-proxy.ts Outdated Show resolved Hide resolved
src/plugins/network/proxy/xhr-proxy.ts Outdated Show resolved Hide resolved
@wqcstrong wqcstrong merged commit aa199fb into main May 31, 2023
@wqcstrong wqcstrong deleted the feat/network branch May 31, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants