Skip to content

wsrv provider always strips https from url parameter #192

@Qendolin

Description

@Qendolin

unpic/src/providers/wsrv.ts

Lines 167 to 174 in d60ab8f

export const generate: URLGenerator<"wsrv"> = (src, operations) => {
const url = new URL("https://wsrv.nl/");
const srcUrl = typeof src === "string" ? src : src.toString();
const cleanSrc = srcUrl.replace(/^https?:\/\//, "");
url.searchParams.set("url", cleanSrc);
const params = operationsGenerator(operations);

Here const cleanSrc = srcUrl.replace(/^https?:\/\//, ""); strips the leading https from any url, this presents issues for images hosted on servers that only allow https access, for example google cloud storage buckets. (wsrv will use http if no protocol is specified).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions