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[sse]: make method and body configurable #985

Closed

Conversation

vegetablechicken233
Copy link

Make HTTP Method configurable and add corresponding test functions.
It should be noted that to ensure backward compatibility, the "method" field does not perform empty validation, but is set to "GET" by default (to align with the old version).
In addition, type of "body" field is temporarily set to "io.Reader" (it seems a bit too early to add support for "any"~

@vegetablechicken233 vegetablechicken233 changed the title feat[sse]: make method and body configurable #983 feat[sse]: make method and body configurable Mar 13, 2025
jeevatkm
jeevatkm previously approved these changes Mar 13, 2025
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.

@vegetablechicken233 Thanks for the PR.

Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.82%. Comparing base (e158f04) to head (0aad9f4).

Additional details and impacted files
@@           Coverage Diff           @@
##               v3     #985   +/-   ##
=======================================
  Coverage   99.81%   99.82%           
=======================================
  Files          18       18           
  Lines        3882     3893   +11     
=======================================
+ Hits         3875     3886   +11     
  Misses          5        5           
  Partials        2        2           
Flag Coverage Δ
unittests 99.82% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vegetablechicken233
Copy link
Author

vegetablechicken233 commented Mar 20, 2025

BTW I use "len(es.onEvent) == 0 " check instead of "if _, found := es.onEvent[defaultEventName]" check.

Sometimes the implementation of the sse server is not standard, and there is no event with the type of message.
In my opinion, users should be able to use it as long as they have added any eventListener.

@jeevatkm

@jeevatkm
Copy link
Member

BTW I use "len(es.onEvent) == 0 " check instead of "if _, found := es.onEvent[defaultEventName]" check.

Sometimes the implementation of the sse server is not standard, and there is no event with the type of message. In my opinion, users should be able to use it as long as they have added any eventListener.

@jeevatkm

@vegetablechicken233 Can you please create a separate PR for this method check changes?

@vegetablechicken233
Copy link
Author

@jeevatkm I created two individual PR for each feature:
#988
#989

Please take the time to review them if you have time. If everything is fine, please close this PR.

@jeevatkm
Copy link
Member

Closing this PR in favor of PR #988 and #989

@jeevatkm jeevatkm closed this Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants