dailymotion / dailymotion-sdk-js

Dailymotion JavaScript client API
https://developers.dailymotion.com/api/platform-api/
MIT License
34 stars 33 forks source link

Was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint #62

Closed leonardop21 closed 6 years ago

leonardop21 commented 6 years ago

I'm trying to upload videos through my site configured with https and using sdk in javascript, however, I get an error stating that the endpoint is not secure.

was loaded by HTTPS, but requested an unsafe XMLHttpRequest endpoint

I did the test on an unsecured connection (http) and the upload occurred without any problems, however, the production site, all the traffic is encrypted, and the dailymotion endpoint is http. How could you solve this problem?

jakub-g commented 6 years ago

Hello @leonardop21 could you provide sample code to repro your issue?

leonardop21 commented 6 years ago

Follow the upload code Jakub-g

In http connection it works normally.

I could not enter the code correctly here, so I put it in the pastebin

https://pastebin.com/z7AJnf8A

SuperToma commented 6 years ago

As @dharFr replied : use ssl_assets in url /file/upload

DM.api('/file/upload?ssl_assets', ...

cf. https://github.com/dailymotion/dailymotion-sdk-js/issues/5#issuecomment-425888913

Regards,

leonardop21 commented 6 years ago

It worked, thanks for the help @SuperToma

Could you add that to the documentation please!

SuperToma commented 6 years ago

I have sent the task in the todo list. Regards.