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

【enhancement】拦截事件可以优化writable stream数据是否被重写的判断逻辑 #1

Open
alanchenchen opened this issue Nov 2, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@alanchenchen
Copy link
Owner

alanchenchen commented Nov 2, 2021

当前是通过判断拦截事件的字符串来正则匹配write, end,和pipe等方法检测,但是存在很多问题:

  • 使用者注释后,正则还是会匹配,只能通过优化正则规则解决
  • 如果使用者调用了write,但是未使用end,http response流依旧未成功返回

优化如下:

  • 使用stream模块,writable stream的writableFinished属性来判断,当前http response流是否不需要插件手动返回原有的服务器数据
@alanchenchen alanchenchen added the enhancement New feature or request label Nov 2, 2021
@alanchenchen alanchenchen changed the title 【enhancement】拦截事件可以优化writable stream的判断逻辑 【enhancement】拦截事件可以优化writable stream数据是否被重写的判断逻辑 Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant