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: options function return false, fix default logger #74

Merged
merged 2 commits into from
Nov 4, 2023

Conversation

xc1427
Copy link
Collaborator

@xc1427 xc1427 commented Nov 3, 2023

This PR does several things:

  • options function now can return false. This allows the middleware to bail out even if path matching succeeds, which could be helpful if you need complex logic to determine whether to proxy or not.
  • Fix the default logger. Because the proxying is done by http-proxy, Getting correct proxied url needs imitating the behavior of http-proxy. The original implementation can log false information in many cases. BE CAUTION that here we rely on inner implementation of http-proxy.
  • Remove and simplify object-rest-spread is still in stage-3 related code. object-rest-spread should be stable now.
  • Fix the github API unit test.
  • Docs, etc

The modification should be backward compatible.

@xc1427 xc1427 force-pushed the cxi.feat.enhanceOptionAsFunction branch from c694246 to 68c6943 Compare November 3, 2023 12:57
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #74 (4b70398) into master (15d3f1c) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #74   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           62        67    +5     
  Branches        14        17    +3     
=========================================
+ Hits            62        67    +5     
Files Coverage Δ
index.js 100.00% <100.00%> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@vagusX
Copy link
Owner

vagusX commented Nov 3, 2023

This pr given us fine-grained control of proxy options function.

Would you like to fix this failing ci @xc1427

test/test.js Show resolved Hide resolved
@vagusX vagusX merged commit 9928ae1 into vagusX:master Nov 4, 2023
8 checks passed
@vagusX
Copy link
Owner

vagusX commented Nov 4, 2023

  • koa-proxies@0.12.4

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