export PLUGIN_NAME and import it in fetchContentFromAlternativeEndpoints

merge-requests/23/head
decrek 2023-12-21 13:16:22 +01:00
rodzic 29ac743432
commit 4d3e088781
Nie znaleziono w bazie danych klucza dla tego podpisu
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -12,7 +12,7 @@ import { fetchContentFromAlternativeEndpoints } from "./lib/fetchContentFromAlte
* the polyfill is implemented in LibResilient's service-worker.js
*/
const PLUGIN_NAME = 'alt-fetch';
export const PLUGIN_NAME = 'alt-fetch';
const LRPC = self.libResilientPluginConstructors;

Wyświetl plik

@ -1,3 +1,5 @@
import { PLUGIN_NAME } from "../index";
export function fetchContentFromAlternativeEndpoints (url, init = {}, config) {
// remove the https://original.domain/ bit to get the relative path
// TODO: this assumes that URLs we handle are always relative to the root