cloudinary / cloudinary_android

Android client for integrating with Cloudinary
MIT License
66 stars 61 forks source link

Set secure all http requests by default #136

Closed adimiz1 closed 2 years ago

adimiz1 commented 2 years ago

Root cause:

As part of the Cloudinary Android SDK major release we want to set https requests as default.

Implementation

The implementation is straight forward and easy, as part of the MediaManager initialisation we set secure variable in the Configuration to true.

This was already set for Android SDK >= 28. All we had to do was remove the if condition and set it to all Android SDKS.

If a user would like to use http calls and not https he would need to set the following line after the MediaManager object has been initialized.

MediaManager.get().getCloudinary().config.secure = false;

There are currently 3 ways to set secure to false but since we dont want to change anything in the Java SDK we decided to go with this way.

What does this PR address?

Are tests included?

Reviewer, please note:

Checklist:

patrick-tolosa commented 2 years ago

The 2 ways of setting secure are: (not 3)

  1. At config level, when initializing
  2. After initialization as stated in the description

We did not want to add another option such as explicitSecure if we could avoid it. Hence the solution in this PR.