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

On windows "/rest/v1/products/" gives a wrong path #71

Closed
sebastiandeutsch opened this issue Sep 4, 2017 · 2 comments
Closed

On windows "/rest/v1/products/" gives a wrong path #71

sebastiandeutsch opened this issue Sep 4, 2017 · 2 comments

Comments

@sebastiandeutsch
Copy link
Contributor

sebastiandeutsch commented Sep 4, 2017

Hi,

I need the mock server to run on Windows. So far it works (though a lot of the directory concatenation has the wrong path separator ¯_(ツ)_/¯).

Unfortunately I have a problem:

http://localhost:3001/rest/v1/products/ - calculates a wrong folder name
http://localhost:3001/rest/v1/products - if I remove the slash it works

Best

Sebastian

sebastiandeutsch added a commit to sebastiandeutsch/node-mock-server that referenced this issue Sep 4, 2017
@smollweide
Copy link
Owner

Hi @sebastiandeutsch,
therefor you should change the foldername eg. with "#" in end or without.
Usually an API definition has just one variant. Removing the slashes isn't my preferred way to fix this.

@sebastiandeutsch
Copy link
Contributor Author

sebastiandeutsch commented Sep 23, 2017

Hi @smollweide,

I guess you're right - an API should have just one definition.

But the path generation on windows is really messed up if I add the trailing slash. The generated path tries to read a file at C:\GET\mock/response.txt. Wouldn't it be lovely to sanity check if the paths are leaving __dirname?

sebastiandeutsch added a commit to sebastiandeutsch/node-mock-server that referenced this issue Sep 29, 2017
sebastiandeutsch added a commit to sebastiandeutsch/node-mock-server that referenced this issue Sep 29, 2017
smollweide added a commit that referenced this issue Jan 7, 2018
…trailing-slash-problem-on-windows

Fixes #71 by removing the trailing slash if 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

Successfully merging a pull request may close this issue.

2 participants