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

Disallow relative module specifies that don't start with "./", "../" #1830

Closed
wants to merge 6 commits into from

Conversation

manyuanrong
Copy link
Contributor

Closes #1769

fn is_absolute(module_name: &str) -> bool {
module_name.starts_with("/") || module_name.starts_with("file://")
}

fn parse_local_or_remote(p: &str) -> Result<url::Url, url::ParseError> {
if is_remote(p) || p.starts_with("file:") {
Url::parse(p)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a unit test to the bottom of this file that demos the change?

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Nice!

@manyuanrong
Copy link
Contributor Author

@ry I submitted some test cases, and the deno_std code has been merged, but I don't know why CI still failed, because it seems that the deno_std/testing code is still the previous one.

@ry
Copy link
Member

ry commented Feb 24, 2019

deno_std has to be upgraded manually - which I'm trying to do here: #1833
Looks like this will be fine after that lands.

@ry
Copy link
Member

ry commented Feb 26, 2019

@manyuanrong Could you please rebase? I think it should work now.

@manyuanrong
Copy link
Contributor Author

There still seems to be a problem with appveyor, but I'm sorry I don't know why. I tried to find the reason, but unfortunately I failed.

@zekth
Copy link
Contributor

zekth commented Mar 25, 2019

There still seems to be a problem with appveyor, but I'm sorry I don't know why. I tried to find the reason, but unfortunately I failed.

For the error in appveyor the only part which changes is the import is a json file instead of a ts file. I will take a look.

@ry
Copy link
Member

ry commented May 9, 2019

Thanks for the PR @manyuanrong, this got the ball rolling which eventually resulted in #2084 - solving the issue. There was some infrastructure work to do first, which is why this wasn't merged.

@ry ry closed this May 9, 2019
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.

Disallow relative module specifies that don't start with "./", "../", "/"
3 participants