Topic on Talk:RESTBase/Archive 2

https://wikimedia.org/api/rest_v1/ returning code 0 and not 200

1
Summary by Jdforrester (WMF)

Duplicate of Topic:Uo3kkmmop1jj9vhw. Follow-up there.

Nyet (talkcontribs)

Using mediawiki 1.31 and Math extension REL_31

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":)

If i change it to allow code 0:


 diff --git a/MathRestbaseInterface.php b/MathRestbaseInterface.php
 index 2dc5d45..5355177 100644
 --- a/MathRestbaseInterface.php
 +++ b/MathRestbaseInterface.php
 @@ -364,7 +364,7 @@ class MathRestbaseInterface {
          */
         public function evaluateRestbaseCheckResponse( $response ) {
                 $json = json_decode( $response['body'] );
 -               if ( $response['code'] === 200 ) {
 +               if ( $response['code'] === 200 || $response['code'] === 0) {
                         $headers = $response['headers'];
                         $this->hash = $headers['x-resource-location'];
                         $this->success = $json->success;
 

I get

Failed to parse (Conversion error. Server ("https://wikimedia.org/api/rest_") reported: "Cannot get mml. Server problem.")

Is the RESTBase server down?