You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/07/15 11:01:42 UTC

[GitHub] [couchdb-nano] bodinsamuel opened a new pull request #270: fix: circular ref error when passing agent

bodinsamuel opened a new pull request #270:
URL: https://github.com/apache/couchdb-nano/pull/270


   ## Overview
   
   When passing an `agent` to nano, the process of scrubbing and logging breaks because of circular refs.
   ![Screenshot 2021-07-15 at 12 56 08](https://user-images.githubusercontent.com/1637651/125777103-6d84e5b2-4f53-476c-9c2c-54d744b53eb4.png)
   
   I have fixed by removing the pointer ref, but an other solution would be to use a deref like `flatted`
   The agent should still in the original object `cfg.requestDefaults` (for the line 380)
   
   ## Testing recommendations
   
   ```ts
   import https from 'https';
   import nano from 'nano';
   
   const httpsAgent = new https.Agent(options);
   const registry = nano({
     url: <YOUR_URL>,
     requestDefaults: {
       agent: httpsAgent,
       timeout: 15000,
       headers: {
         'user-agent': 'fdfd',
         'Accept-Encoding': 'deflate, gzip',
         'content-type': 'application/json',
         accept: 'application/json',
       },
     },
   });
   ```
   
   ## Checklist
   
   - [x] Code is written and works correctly;
   - [ ] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-nano] bodinsamuel commented on pull request #270: fix: circular ref error when passing agent

Posted by GitBox <gi...@apache.org>.
bodinsamuel commented on pull request #270:
URL: https://github.com/apache/couchdb-nano/pull/270#issuecomment-880721142


   There is not much activity on this repo so not sure if someone is handling it.
   cc @glynnbird ☺️ 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-nano] glynnbird merged pull request #270: fix: circular ref error when passing agent

Posted by GitBox <gi...@apache.org>.
glynnbird merged pull request #270:
URL: https://github.com/apache/couchdb-nano/pull/270


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org