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

feat: add proxyRequest util #226

Merged
merged 5 commits into from
Nov 3, 2022
Merged

feat: add proxyRequest util #226

merged 5 commits into from
Nov 3, 2022

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Nov 3, 2022

Resolves #224 (Thanks @P4sca1 for suggestion)

This PR adds a new proxyRequest utility built on top of sendProxy that proxies incoming request headers, body and method to target. (path is not rewritten)

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #226 (8a2ef5b) into main (e6a9f94) will increase coverage by 0.32%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
+ Coverage   76.34%   76.67%   +0.32%     
==========================================
  Files          20       20              
  Lines        1171     1209      +38     
  Branches      222      227       +5     
==========================================
+ Hits          894      927      +33     
- Misses        277      282       +5     
Impacted Files Coverage Δ
src/utils/proxy.ts 84.52% <87.50%> (+1.91%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0 pi0 merged commit 501f0c6 into main Nov 3, 2022
@pi0 pi0 deleted the feat/proxy-request branch November 3, 2022 19:49
@scripness
Copy link

@pi0 is it supposed not to rewrite the path? I still get the path rewritten - proxying in a nuxt server middleware to an internal route, just trying to hide some path in the url.

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.

Proxy request method, headers and body with sendProxy()
2 participants