Paket icon indicating copy to clipboard operation
Paket copied to clipboard

Source protocol changes from HTTPS to HTTP

Open 0x022b opened this issue 10 years ago • 8 comments

When a NuGet v3 API is used the source protocol changes from HTTPS in paket.dependencies to HTTP in paket.lock.

0x022b avatar Nov 30 '16 08:11 0x022b

It's just normalizing the url. It should still always use the https in the calls. Can you please check if that's true?

Am 30.11.2016 09:30 schrieb "Janne K" [email protected]:

When a NuGet v3 API is used the source protocol changes from HTTPS in paket.dependencies to HTTP in paket.lock.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Paket/issues/2053, or mute the thread https://github.com/notifications/unsubscribe-auth/AADgNHIR7k6HqS6FHCde6vuuKoHSMdCoks5rDTQtgaJpZM4K_7XD .

forki avatar Nov 30 '16 08:11 forki

See scoobadog/PaketRepro@85f42853b7af6b8251f5900fa416d64323d4f921 for a repro

0x022b avatar Nov 30 '16 08:11 0x022b

According to verbose log it's using v2 API over HTTP

Downloading AutoMapper 5.2
Response from http://nuget.org/api/v2/Packages?$filter=(tolower(Id) eq 'AutoMapper') and (Normalized
Version eq '5.2.0'):

0x022b avatar Nov 30 '16 08:11 0x022b

offending code

let normalizeFeedUrl (source:string) =
    match source.TrimEnd([|'/'|]) with
    | "https://api.nuget.org/v3/index.json" -> Constants.DefaultNuGetV3Stream 
    | "http://api.nuget.org/v3/index.json" -> Constants.DefaultNuGetV3Stream.Replace("https","http")
    | "https://nuget.org/api/v2" -> Constants.DefaultNuGetStream
    | "http://nuget.org/api/v2" -> Constants.DefaultNuGetStream.Replace("https","http")
    | "https://www.nuget.org/api/v2" -> Constants.DefaultNuGetStream
    | "http://www.nuget.org/api/v2" -> Constants.DefaultNuGetStream.Replace("https","http")
    | url when url.EndsWith("/api/v3/index.json") -> url.Replace("/api/v3/index.json","")
    | source -> source

https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/Utils.fs

cloudRoutine avatar Dec 01 '16 10:12 cloudRoutine

we should normalize to https

forki avatar Dec 01 '16 10:12 forki

#2071 should fix the issue, but I didn't test it nor checked if there exists related test. If it's not enough, I'll dig it later this week.

eugene-g avatar Dec 06 '16 18:12 eugene-g

Already released. I just tested and it works.

eugene-g avatar Dec 07 '16 13:12 eugene-g

Thanks guys for a quick fix.

0x022b avatar Dec 08 '16 09:12 0x022b