Page MenuHomePhabricator

api.php over HTTPS (SSL) does not work
Closed, InvalidPublic

Description

Author: ddidderr

Description:
This is the api SSL link which shows the documentation: https://secure.wikimedia.org/wikipedia/en/w/api.php

But if I pass parameters like: https://secure.wikimedia.org/wikipedia/en/w/api.php?action=opensearch&format=json&search=abc it doesn't work anymore. Istead of showing the page with the results, the browser tries to download the api.php. After downloading it, you can open it and the results are correctly in it.
I use the Firefox extension HTTPS-Everywhere from the EFF. So it would be great if the api.php would also work correctly via HTTPS.

Thanks!
Paul


Version: unspecified
Severity: normal

Details

Reference
bz26834

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:17 PM
bzimport set Reference to bz26834.

ddidderr wrote:

I'm sorry, I just tested in Chromium browser, and it works fine. So it must be firefox... Do you have any idea what could be wrong?

same issue there with IE7 & Firefox 3.6.13

What does format=jsonfm give?

Bryan.TongMinh wrote:

I don't see why this is an issue. The same thing applies to HTTP connections. The fact that the browser does not open it, is caused by the content-type that we send along (something like application/json or whatever).

This is not a bug... the api is working the same in http and non-https.

You are explicitly requesting the json format, and hence the api sends a application/json content-type, most browsers don't have any special handling for json, so they prompt you to download the result as they do with other unknown filetypes. If you want a html preview of the json then use format=jsonfm.

ddidderr wrote:

(In reply to comment #3)

What does format=jsonfm give?

A normal HTML page loads. It says "You are looking at the HTML representation of the JSON format[...]" and below the JSON search results. I just tried format=xml, that works. I opened Firebug to check what Headers are send, but in case of format=json it shows nothing, maybe because firefox is directly trying to download the page.

(In reply to comment #4)

I don't see why this is an issue. The same thing applies to HTTP connections.
The fact that the browser does not open it, is caused by the content-type that
we send along (something like application/json or whatever).

No, sorry, the problem is: In HTTP, the api works fine with the wikipedia searchplugin in firefox. if I change the url in the wikipedia searchplugin's xml file to the HTTPS url, it doesn't work anymore. And to check that I use the right URL, I just typed it into the browser directly. There I noticed, that in HTTP the browser just shows the json, in HTTPS tries to download it. Maybe it has nothing to do with my problem, but I thought there could be a link.

Bryan.TongMinh wrote:

The same URL is used for the search box at the top of the page, which works in HTTPS.

ddidderr wrote:

I just got it working. There's another big problem:
Without SSL I can type something into the searchbox and immediately get suggestions. With SSL I can type for example 'asd' and get nothing, even if I wait a long time. Now I can remove the 'd' and type it again, then I get the results. Ok, maybe an implementation issue, I will ask the firefox devs.