Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid URL when redirected #16

Closed
Roosteridk opened this issue Feb 25, 2023 · 1 comment
Closed

Invalid URL when redirected #16

Roosteridk opened this issue Feb 25, 2023 · 1 comment

Comments

@Roosteridk
Copy link
Contributor

There seems to be an issue with redirects after v5.0.0 where I get an invalid URL error for a redirected request.

import { wrapFetch } from "https://deno.land/x/another_cookiejar@v5.0.2/mod.ts";

const fetch = wrapFetch();
fetch("https://eksisozluk.com/deno"); // Redirects to https://eksisozluk.com/deno--89984
error: Uncaught (in promise) TypeError: Invalid URL: '/deno--89984'
  const orig = new URL(original).hostname;
               ^
    at getSerialization (internal:deno_url/00_url.js:74:11)
    at opUrlParse (internal:deno_url/00_url.js:65:10)
    at new URL (internal:deno_url/00_url.js:363:27)
    at isDomainOrSubdomain (https://deno.land/x/another_cookiejar@v5.0.2/fetch_wrapper.ts:25:16)
    at wrappedFetch (https://deno.land/x/another_cookiejar@v5.0.2/fetch_wrapper.ts:123:10)

However, using v4.1.5 works just fine.

@jd1378
Copy link
Owner

jd1378 commented Feb 27, 2023

thanks for reporting this
I have released a fix and added a test for it

@jd1378 jd1378 closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants