← Back to team overview

dhis2-devs team mailing list archive

Re: CORS: accessing HTTP from HTTPS

 

Hi Jason

I'm not clued up on server configurations but I tried swapping http to
https - it's unsupported. I was hoping there's an easy ajax header setting
i need to add. As per your suggestion - i'll ask the guys to enable https
for that server...

Kind Regards,
Greg



On Thu, Sep 29, 2016 at 1:38 PM, Jason Pickering <
jason.p.pickering@xxxxxxxxx> wrote:

> Maybe http://my-dhis2-analytics-call.json/?etc needs to be
> https://my-dhis2-analytics-call.json/?etc ?
>
> On Thu, Sep 29, 2016 at 1:09 PM, Greg Rowles <greg.rowles@xxxxxxxxx>
> wrote:
>
>> Hi Devs
>>
>> Sorry, I'm running into all kinds of issues with CORS today:
>>
>> Mixed Content: The page at 'https://my-source-page.html' was loaded over
>> HTTPS, but requested an insecure XMLHttpRequest endpoint '
>> http://my-dhis2-analytics-call.json?etc'. This request has been blocked;
>> the content must be served over HTTPS.
>>
>> Any suggestions for amending my ajax call below? I'm accessing http from
>> https, guessing my headers:need to be configured correctly:
>>
>>
>>  $.ajax({
>> url: base + dxAPI,
>> headers: { "Authorization": 'Basic ' + btoa(user + ':' + pwd) },
>> timeout: 30000,
>> crossDomain: true,
>> success : function(data){ ...etc
>>
>> Works wonderfully from regular HTTP.
>>
>> Regards,
>> Greg
>>
>>
>> --
>> *Health Information Systems Program - South Africa*
>> *- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - - -
>> - *
>> Mobile  :    073 246 2992
>> Landline:   021 851 2216
>> Skype:      gregory_rowles
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx
> tel:+46764147049
>



-- 
*Health Information Systems Program - South Africa*
*- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - - - - *
Mobile  :    073 246 2992
Landline:   021 851 2216
Skype:      gregory_rowles

References