Skip to content

Conversation

@rg1
Copy link
Contributor

@rg1 rg1 commented Mar 14, 2018

Description

Analogous to Issue #1249, I would need the responseInterceptor to be able to modify the response asynchronously.

Motivation and Context

The idea is for the responseInterceptor to make another request and use the result in place of the previously received one. In particular I need this, because I need to handle redirect requests myself, because I need to receive cookies set on the redirect response.

How Has This Been Tested?

I've added a test to the test suite that performs a new request from the responseInterceptor (although from an error response, not a redirect).

Types of changes

  • No code changes (changes to documentation, CI, metadata, etc)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@webron webron requested a review from shockey March 14, 2018 17:08
Copy link
Contributor

@shockey shockey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather this PR use async/await syntax, since we have support for it 😄

@rg1
Copy link
Contributor Author

rg1 commented Mar 16, 2018

I've updated the code to use async/await as requested. Sorry that I didn't realize it was supported.

I guess fixing #1249 is now simply a matter of adding another await (and a test). I could add that as well if you like, or submit another pull request once this is merged.

@shockey
Copy link
Contributor

shockey commented Mar 20, 2018

@rg1 please do! might as well knock both out at once 😄

@rg1
Copy link
Contributor Author

rg1 commented Mar 22, 2018

@shockey I've pushed the change Monday. Is anything else needed?

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

Successfully merging this pull request may close these issues.

2 participants