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

getAbsPath in service works poorly #753

Closed
junaire opened this issue Sep 13, 2021 · 2 comments
Closed

getAbsPath in service works poorly #753

junaire opened this issue Sep 13, 2021 · 2 comments

Comments

@junaire
Copy link
Member

junaire commented Sep 13, 2021

I found there is something wrong with our current getAbsPath implementation:

  • Why it just simply splice workDir and path without / ?
  • It doesn't check the input, so it might splice workDir and absolute path again, which means it can be easily misused.

image

Is there anything wrong with getRelPath too?

@Xuanwo
Copy link
Contributor

Xuanwo commented Sep 13, 2021

getAbsPath and getRelPath are designed to be implemented by the service itself. Maybe the problem is introduced by borrowing code from other services directly? It's OK to refactor getAbsPath and getRelPath.

@junaire
Copy link
Member Author

junaire commented Sep 13, 2021

getAbsPath and getRelPath are designed to be implemented by the service itself. Maybe the problem is introduced by borrowing code from other services directly? It's OK to refactor getAbsPath and getRelPath.

Got it.

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

No branches or pull requests

2 participants