My URLs are returned in the HTTP instead of HTTPS.

AjLab
AjLab Member Posts: 2
edited December 2023 in Developer APIs

Hello,

I am a beginner developer and I have been very happy with cloudinary for my asp.net core web api image upload, but the upload result returns a http url instead of https even after setting my params up like so       

var account = new Account(

        cloudinarySettings.CloudName,

        cloudinarySettings.ApiKey,

        cloudinarySettings.ApiSecret);


      var cloudinary = new Cloudinary(account);

      cloudinary.Api.Secure = true;

Please help me..

Tagged:

Answers

  • Wissam
    Wissam Member, Cloudinary Staff Posts: 64

    Hi @AjLab ,

    I have tried your code and I do get "url" and "secure_url".

    Try the following:

    cloudinary = new Cloudinary(account);

    cloudinary.Api.Secure = true;

    var result = cloudinary.GetResource("sample");

    Console.WriteLine(result.JsonObj.ToString());

    Please let me know how it goes.

    Regards,

    Wissam

  • AjLab
    AjLab Member Posts: 2

    Hi @Wissam

    the problem was that I had the database save the URL instead of SecureUrl thinking that enabeling the secure to true would automatically make the url https, I am new so I apologise for my insight, but you comment has hellped me so thank you.

  • Wissam
    Wissam Member, Cloudinary Staff Posts: 64

    Hi @AjLab ,

    Thank you for the update. I'm glad I could help.

    Best Regards,

    Wissam