Getting error from heroku in regards to HTTPS

asosnovsky

I have an app written with angular and deployed over nodejs to heroku. When I run it in development mode on my home computer everything is awesome, and no errors occur. But once I deliver it to heroku I get the following error message on the console:

Mixed Content: The page at 'https://yasawebsite.herokuapp.com/#/' was loaded
over HTTPS, but requested an insecure script
'http://api.tumblr.com/v2/blog/asayorku.tumblr.com/posts?api_key=[MY SECTRET API-KEY]&callback=angular.callbacks._0'. 
This request has been blocked; the content must be served over HTTPS.

Is there an issue with how I call my data from tumblr up?

this is what I am doing:

$http.jsonp('http://api.tumblr.com/v2/blog/asayorku.tumblr.com/posts?api_key=[MY SECRET API Key]&callback=JSON_CALLBACK')
  .success(function (data) {
    // my data analysis process
  });

And this is what I have setup over at my server.js file

var express = require('express')
    , morgan = require('morgan')
    , bodyParser = require('body-parser')
    , methodOverride = require('method-override')
    , app = express()
    , port = process.env.PORT || 3000
    , router = express.Router();

app.use(express.static(__dirname + '/dist'));
app.use(morgan('dev'));
app.use(bodyParser());
app.use(methodOverride());

router.get('/', function(req, res, next) {
    res.render('index.html');
});

app.use('/', router);

app.listen(port);
console.log('App running on port', port);

I'd like to stress that everything works except for the data call I make with $http, should I be using the vanilla js or jquery methods? if so why is this happening o.0 ?

Also the reason it calls a /dist folder is because the app is minified by Grunt first.

idbehold

Try changing your API request to this (make the protocol relative):

$http.jsonp('//api.tumblr.com/v2/blog/asayorku.tumblr.com/posts?api_key=[MY SECRET API Key]&callback=JSON_CALLBACK')
  .success(function (data) {
    // my data analysis process
  });

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Upgraded to HTTPS and getting error from gtmetrix, unable to connect to the server

Is there an error in my code with regards to the question

Getting images from https with Java

django app in heroku getting worker timeout error

Binding to Heroku dynamic $PORT and keep getting error?

Getting error "ImportError: No module named" on Heroku but not locally

Getting an error when deploying a Django app to Heroku

Getting error when browse website with https

SQL server error in regards to common table expression

Error Switching from AWS to Heroku?

Receive feedback from SonarQube in regards to design and architecture

Getting Json data from https client

How to redirect a nextjs app hosted on Heroku from http to https?

I deployed my app on heroku and I am getting this error on running heroku logs tail "Error connecting to the database"

Trying to deploy node.js to Heroku: getting compile error?

Akka app to Heroku getting error: Web process failed to bind to $PORT

Flask App on Heroku getting Application Error after deploy

heroku error when searching my DB is this the DB getting overloaded

I am trying to deploy django application using heroku but getting error?

Why getting this error for Laravel JWT auth on heroku server

I'm getting an error when attempting to set up nginx on Heroku

Getting "Cannot find module '/app/dist'" error on deploying to Heroku

Getting SSL error after downgrading to free dyno on Heroku

Getting two unknown error while trying to upload my app to Heroku

getting a 404 error when trying to navigate to signin route in heroku

Getting error while deploying keycloak docker image to Heroku

Getting started with django and heroku, "application error" after upload

Heroku not updating, getting error "Yarn executable was not detected in system"

Getting error 1009 from a function?