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

Remove the additional slash. #25

Merged

Conversation

rolfwessels
Copy link
Contributor

The base should be 'https://nuget.xxxxxxxxxxxxxx.com/' and not 'http://nuget.xxxxxxxxxxxxxx.com//.'
It seems to be the double slash at the end that is breaking the request.

Nuget tries to resolve it to
Resolved actions to install package 'xxxxxxxxxx.5.1.0.47-develop'
GET http://nuget.xxxxxxxxxxxxxx.com//download/xxxxxxxxxx/5.1.0.47-develop

When I call that directly I only a response Only DELETEs allowed here. If I remove the double slash it works.

The base should be 'https://nuget.xxxxxxxxxxxxxx.com/' and not 'http://nuget.xxxxxxxxxxxxxx.com//.'
It seems to be the double slash at the end that is breaking the request.

Nuget tries to resolve it to
Resolved actions to install package 'xxxxxxxxxx.5.1.0.47-develop'
`GET http://nuget.xxxxxxxxxxxxxx.com//download/xxxxxxxxxx/5.1.0.47-develop`

When I call that directly I only a response Only DELETEs allowed here. If I remove the double slash it works.

See this issue.
sunsided/docker-nuget#7 for more details.
@Daniel15
Copy link
Owner

I think it should actually check if dirname($_SERVER['REQUEST_URI']) ends in /. Omitting the slash won't work if it's in a subdirectory (eg. http://xxxxxx.com/nuget/download/....)

This is likely a better fix:

-			dirname($_SERVER['REQUEST_URI']) . '/';
+			rtrim(dirname($_SERVER['REQUEST_URI']), '/') . '/';

Would you be willing to test that out and update this PR?

@rolfwessels
Copy link
Contributor Author

Makes sense. Will test it out.

@rolfwessels
Copy link
Contributor Author

It worked for me.

@Daniel15 Daniel15 merged commit dc7e465 into Daniel15:master Jan 11, 2018
@rolfwessels rolfwessels deleted the rolfwessels-fix-double-slash-on-download branch January 11, 2018 07:09
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.

None yet

2 participants