URSH: Switch to URL polyfill

This commit is contained in:
Ergys Dona 2018-09-03 17:05:13 +02:00 committed by Adrian Moennich
parent aa8bb6d8e8
commit eb138ba83b
2 changed files with 22 additions and 2 deletions

View File

@ -15,6 +15,7 @@
* along with Indico; if not, see <http://www.gnu.org/licenses/>.
*/
import 'url-polyfill';
import {handleAxiosError, indicoAxios} from 'indico/utils/axios';
@ -41,8 +42,8 @@ function _validateAndFormatURL(url) {
}
// if protocol is missing, prepend it
if (url.startsWith(window.location.hostname)) {
url = `${window.location.protocol}//${url}`;
if (url.startsWith(location.hostname)) {
url = `${location.protocol}//${url}`;
}
let parsedURL;

19
ursh/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "indico-plugin-ursh",
"version": "1.0.0",
"description": "URL shortening service provider for Indico",
"main": "indico_ursh/client/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/indico/indico-plugins.git"
},
"author": "Indico Team <indico.team@cern.ch>",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/indico/indico-plugins/issues"
},
"homepage": "https://github.com/indico/indico-plugins#readme",
"dependencies": {
"url-polyfill": "^1.1.0"
}
}