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

Lowercased SourceLocation #11

Closed
MassimoSporchia opened this issue May 22, 2018 · 5 comments
Closed

Lowercased SourceLocation #11

MassimoSporchia opened this issue May 22, 2018 · 5 comments

Comments

@MassimoSporchia
Copy link

Hello,

is there a particular reason to have the SourceLocation lowercased?

In particular in these two situations:

and

'source_location' = $_.SourceLocation.ToLower()

Since I think most of the webserver out there doesn't rewrite urls (e.g. Nexus Sonatype doesn't do it), I was wondering if removing these parameter alteration would be a thing.

@hbuckle
Copy link
Owner

hbuckle commented May 22, 2018

Hi - this is just an internal thing to make it easier to compare strings. Although URLs aren't case sensitive, Puppet is so if the casing were different Puppet would think it needed to be changed. It should have no effect on actually interacting with repos.

@MassimoSporchia
Copy link
Author

MassimoSporchia commented May 22, 2018

It does affect the interaction with repos, this code for example doesn't work with the lowercase:

psrepository { 'PSGalleryProxy':
    ensure              => present,
    source_location     => 'http://mylocalnexus/repository/PowerShellGallery_proxy/',
    installation_policy => 'untrusted',
    provider            => 'windowspowershell',
  }

Since a call to "http://mylocalnexus/repository/PowerShellGallery_proxy/" returns 200, a call to "http://mylocalnexus/repository/powershellgallery_proxy/" returns 404 so the Set-PSRepository command returns malformed URL

@hbuckle
Copy link
Owner

hbuckle commented May 24, 2018

Ah ok, I didn't know that some servers treated the URL as case sensitive. I should be able to update this to remove the lower casing.

@MassimoSporchia
Copy link
Author

MassimoSporchia commented May 24, 2018

I've got minimal modification in my current workspace, if you want I'll make a pull request :)
(which basically removes the lowercasing lines I've put in the issue, by the way) but I'm guessing there is much more than those 2 lines

@hbuckle
Copy link
Owner

hbuckle commented Jul 12, 2018

2.0.0 makes source location case sensitive

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