Skip to content

Fixed a bug which caused allow_redirects to be listed twice in python requests #74

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

Merged
merged 4 commits into from
Aug 30, 2019

Conversation

shreys7
Copy link
Member

@shreys7 shreys7 commented Aug 19, 2019

This PR fixes #73

…ted twice when follow redirect options is set to false
@abhijitkane
Copy link
Member

This PR foxes #73
Really?

@shreys7 shreys7 requested a review from abhijitkane August 20, 2019 09:20
@@ -110,7 +110,6 @@ self = module.exports = {
', data = payload, files = files' : ', data = payload';
snippet += !options.followRedirect ? ', allow_redirects=False' : '';
Copy link
Member

@VShingala VShingala Aug 21, 2019

Choose a reason for hiding this comment

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

Leave space behind and after = in allow_redirects=False in generated python code. as we are doing the same in other places. i.e data = payload and files = files.

Also update test according to it.

expect.fail(null, null, err);
}
expect(snippet).to.be.a('string');
expect(snippet).to.not.include('allow_redirects=False, allow_redirects=false');
Copy link
Member

Choose a reason for hiding this comment

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

If options.requestTimeout !== 0 is true than this will be not valid as generated snippet will have allow_redirects=False, timeout=${options.requestTimeout}, allow_redirects=false.

@shreys7 shreys7 merged commit 3ede978 into develop Aug 30, 2019
@umeshp7 umeshp7 deleted the feature/bugfix-pythonrequests-followRedirects branch September 27, 2019 11:21
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.

allow_redirects being added twice in Python requests
3 participants