fix: rm superfluous header on actor example
Similar to: https://github.com/dapr/go-sdk/issues/218
There is a superfluous header call show in the actors example:
al.placement type=log ver=edge
DEBU[0004] Executing reminder for actor testActorType||ActorImplID123456||testReminderName app_id=actor-serving instance=Samanthas-MacBook-Pro-2.local scope=dapr.runtime.actor type=log ver=edge
== APP == 2023/09/08 14:15:37 failed to unmarshal reminder param, err: illegal base64 data at input byte 4
== APP == 2023/09/08 14:15:37 http: superfluous response.WriteHeader call from github.com/dapr/go-sdk/service/http.(*Server).registerBaseHandler.func6 (topic.go:199)
With the removal of the line in this PR, the superflous header is removed:
DEBU[0002] Executing reminder for actor testActorType||ActorImplID123456||testReminderName app_id=actor-serving instance=Samanthas-MacBook-Pro-2.local scope=dapr.runtime.actor type=log ver=edge
== APP == 2023/09/08 14:16:24 failed to unmarshal reminder param, err: illegal base64 data at input byte 4
Codecov Report
Patch coverage: 66.66% and project coverage change: -0.91% :warning:
Comparison is base (
4afb831) 70.00% compared to head (0c6cce8) 69.09%. Report is 10 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #444 +/- ##
==========================================
- Coverage 70.00% 69.09% -0.91%
==========================================
Files 33 34 +1
Lines 2667 2741 +74
==========================================
+ Hits 1867 1894 +27
- Misses 698 737 +39
- Partials 102 110 +8
| Files Changed | Coverage Δ | |
|---|---|---|
| client/client.go | 70.24% <33.33%> (+0.50%) |
:arrow_up: |
| service/http/topic.go | 87.79% <83.33%> (-1.58%) |
:arrow_down: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
We still need the write header line that was removed, because it accounts for a situation where there's no error. What needs to be done is to add a return statement in all other WriteHeader code blocks before the StatusOk one. There are other places in the code with the same issue, so it'd be great to add those return statements there too.
ping @sicoyle
pong @yaron2 😄
Could we add a test for it?
Hi @daixiang0 @sicoyle , can this be merged asap please?