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

Stop using deprecated API #277

Open
klippx opened this issue Jan 23, 2022 · 0 comments
Open

Stop using deprecated API #277

klippx opened this issue Jan 23, 2022 · 0 comments

Comments

@klippx
Copy link
Collaborator

klippx commented Jan 23, 2022

There is a FIXME in src/gateway/http.js

    // FIXME: Deprecated API
    // eslint-disable-next-line n/no-deprecated-api
    const defaults = url.parse(this.request.url())

However, url.parse(this.request.url()) is not equal to new URL(this.request.url()). So changing this might not necessarily be as trivial as that (which is also confirmed by breaking the spec spec/node/gateway/http.spec.js).

    {
      urlParse: Url {
        auth: null,
        hash: null,
        host: 'example.org',
        hostname: 'example.org',
        href: 'http://example.org/api/examples.json'
        path: '/api/examples.json',
        pathname: '/api/examples.json',
        port: null,
        protocol: 'http:',
        query: null,
        search: null,
        slashes: true,
      },
      // missing keys: auth (which is used), hash, path (which is used), query (which is used)
      // new keys: origin, password, searchParams, username
      newUrl: URL { 
        hash: '' // used to be null
        host: 'example.org',
        hostname: 'example.org',
        href: 'http://example.org/api/examples.json',
        origin: 'http://example.org',
        password: '',
        pathname: '/api/examples.json',
        port: '', // used to be null
        protocol: 'http:',
        search: '', // used to be null
        searchParams: URLSearchParams {},
        username: '',
      }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant