I have a relatively simple Laravel app, that features an HTML form which contains a tag select element. The select element gets enhanced via select2 library. The tags are fetched via an XMLHttpRequest. I've created a fiddle, and the error I receive there is the same as on my production machine:
[...]was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://blog.mazedlx.net/tags?term=asd'. This request has been blocked; the content must be served over HTTPS.
$('#tags_id').select2({
minimumInputLength: 2,
tags: true,
tokenSeparators: [','],
ajax: {
url: 'https://blog.mazedlx.net/tags/',
type: 'GET',
dataType: 'json',
data: function (params) {
var queryParameters = {
term: params.term
}
return queryParameters;
},
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.tag,
id: item.id
};
})
};
}
}
});
As you can see in the fiddle the ajax url contains https, and the page containing the form is also served over https. The url also yields results: e.g. https://blog.mazedlx.net/tags?term=php. What am I doing wrong?
http://
protocol, nothttps://
, hence the error – Excelhttps
resource – Pleasanthttp
my server is configured to redirect tohttps
, always. – Pleasant$request->secure()
but it returnsfalse
although the page is served viahttps
. I am not behind any proxy oder hoster. – Pleasant