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

timeout value 0 does not disable timeout #443

Closed
2 tasks done
soanaphikeste opened this issue Dec 20, 2021 · 2 comments
Closed
2 tasks done

timeout value 0 does not disable timeout #443

soanaphikeste opened this issue Dec 20, 2021 · 2 comments

Comments

@soanaphikeste
Copy link

Describe the bug
When setting the global timout to 0, it remains at the default value even though 0. This is normally an accepted value that would disable the timeout completely.

To Reproduce
Issuer and Client configuration: (inline or gist) - Don't forget to redact your secrets.

import { Issuer, custom } from 'openid-client';

custom.setHttpOptionsDefaults({
    timeout: 0
});

await Issuer.discover('https://some-url-to-extremely-slow-server.example.com')

Steps to reproduce the behaviour:

  1. Set the global timeout option to 0
  2. Call an extremely slow server (e.g. using Issuer.discover)
  3. Observe that a timeout error is thrown with the message RPError: outgoing request timed out after 3500ms

Expected behaviour
There should not be a timout error or at least not one generated by openid-client. 3500ms is the default timeout imposed by this library, which leads me to believe that overriding the timeout did not have any effect

Environment:

  • openid-client version: 5.0.2
  • node version: 12.22.5

Additional context
The issue is most likely in the pick function, which checks for thruthy values whn selecting things.

  • the bug is happening on latest openid-client too.
  • i have searched the issues tracker on github for similar issues and couldn't find anything related.
@panva
Copy link
Owner

panva commented Dec 20, 2021

If you change the pick function to if (object[path] !== undefined) {, do you observe the expected behaviour?

@soanaphikeste
Copy link
Author

Yes, that produces the expected behavior

@panva panva closed this as completed in 32b28b5 Dec 20, 2021
@panva panva removed the triage label Dec 20, 2021
@panva panva changed the title Timeout 0 not accepted timeout value 0 does not disable timeout Dec 20, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants