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

Fix - request: execute user defined middlewares after resty's internal middlewares #355

Merged
merged 2 commits into from
Sep 4, 2020

Conversation

lggomez
Copy link
Contributor

@lggomez lggomez commented Jul 20, 2020

This allows middlewares to properly access the RawRequest instance and follow their expected behavior according to OnBeforeRequest:

// OnBeforeRequest method appends request middleware into the before request chain.
// Its gets applied after default Resty request middlewares and before request
// been sent from Resty to host server.

@codecov
Copy link

codecov bot commented Jul 20, 2020

Codecov Report

Merging #355 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #355   +/-   ##
=======================================
  Coverage   96.18%   96.18%           
=======================================
  Files          10       10           
  Lines        1231     1231           
=======================================
  Hits         1184     1184           
  Misses         26       26           
  Partials       21       21           
Impacted Files Coverage Δ
client.go 96.72% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b87f65c...b48bc70. Read the comment docs.

@lggomez
Copy link
Contributor Author

lggomez commented Jul 21, 2020

@jeevatkm it seems travis is stuck, the local tests run fine

If you're ok with this changeset post ci, would you mind making a v2.3.1 release so I can update from latest on my project?

Thanks in advance

@jeevatkm
Copy link
Member

@lggomez Thank you for your PR. Seems like something is wrong in the travis integration. Will check it.

Signed-off-by: Jeevanandam M <jeeva@myjeeva.com>
Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

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

@lggomez Thanks for the PR. I'm sorry for the delayed response.

Also, Travis build has been addressed.

@almas1992
Copy link

Why this merged change not included in V2.6.0 ?I would get raw request in custom middlewares , but the raw request is nill now .

@ForsakenHarmony
Copy link

It was reverted #414

Is there any chance you'll add something like this back? @jeevatkm

@NeoCN
Copy link

NeoCN commented Sep 13, 2021

@jeevatkm Is there any release plan about this change? We can not upgrade to new versions without this.

@jeevatkm
Copy link
Member

@NeoCN Actually this PR was not a fix. That's why it was got reverted. I accidentally merged without realizing it on my bad day.
Resty middleware flow is designed this way from day one. If you would like to manipulate the RawRequest before sending out the request, kindly make use of PreRequestHook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Analyzes and Fix Travis Build issue, many PRs are waiting.
5 participants