Extension:ApiSVGProxy

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
API SVG proxy

Release status: experimental

Implementation API
Description Adds an API module that proxies SVG files from a (possibly remote) file repository to the local domain
Author(s) Roan Kattouw (Catropetalk)
MediaWiki 1.15
License GPL
Download

Translate the ApiSVGProxy extension if possible

Check usage and version matrix; code metrics

What this extension does[edit | edit source]

This extension acts as a proxy between a remote file repository and local JavaScript. It allows you to access SVG files from a remote repository at a local URL, circumventing cross-domain restrictions.

Usage and restrictions[edit | edit source]

To access a remote SVG file locally, request api.php?action=svgproxy&file=File:Example.svg. Only files with the .svg extension and the image/svg+xml MIME type can be proxied.

Errors[edit | edit source]

When the SVG proxy fails, it will return an XML-formatted error result and an HTTP status code indicative of the error.

  • code: nosuchfile
    • info: The specified file does not exist
    • HTTP status code: 404
  • code: notsvg
    • info: The specified file is not an SVG file
    • HTTP status code: 403
  • code: fetchfailed
    • info: The specified file could not be fetched
    • HTTP status code: 500