8000 add ability to send back something other than the default by jackiereh · Pull Request #89 · didip/tollbooth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add ability to send back something other than the default #89

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 3 commits into from
Oct 3, 2020

Conversation

jackiereh
Copy link
Contributor

Why:

  • the test is just a basic check that you can override what's originally sent, but the actual reason for this override originates from the desire to use this wonderful repo in one of my applications, but I am required to send back a special error proto object not just a simple message. (on top of that, the responses content type often toggles in-between application/json & application/x-protobuf)
  • it would be super cool if I could control the full process of what happens when the limit is reached, including what get's sent back to the user ( currently if I send it back what I want, I get trouble when it tries to write back twice )

What:

  • this override when set allows the user to control the full process of what get's written back
  • the override defaults to false unless users go out of their way to change it. So all original behavior stays the same.

Tests:

  • all previous test still pass
  • added very basic test for proof of concept

@jackiereh
Copy link
Contributor Author

There very well could be a better way of doing this.
I'm required to send back protos for the response (even with errors like limits being reached).
https://developers.google.com/protocol-buffers

If someone has figured out a way around this, I'd love to know about it, otherwise, it would be awesome to able to use tollbooth, and have control of what get's sent back.

@didip
Copy link
Owner
didip commented Oct 3, 2020

I see. Looks simple enough, are you done making changes?

@jackiereh
Copy link
Contributor Author

Hi @didip, I really like this pkg and what it offers. It won't let me add any reviews to this pull request. I know people usually have rules/procedures about who and what can be added, so I'm looking for advice for what to do next.
I wanted to create this to show what I'd like to do, and ask for options maybe around this, or if this is something that could be added?

Thank you!

@jackiereh
Copy link
Contributor Author
jackiereh commented Oct 3, 2020

Oh sorry I commented before I saw your comment! Yes I am done with my changes 👍 this is an awesome pkg by the way, thanks for making this!

@didip didip merged commit 36f42d5 into didip:master Oct 3, 2020
@didip
Copy link
Owner
didip commented Oct 3, 2020

Not much process with this project. If it works and has tests, usually it gets merged. :)

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

Successfully merging this pull request may close these issues.

2 participants
0