-
Notifications
You must be signed in to change notification settings - Fork 224
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
Parsing CloudEvent from HTTP response for 4xx,5xx status codes. #558
Comments
@n3wscott wdyt? Is it a bug? |
This should work if the headers are correct as well, can you make a little demo or paste the raw http body of the response? |
Response as seen in WireShark:
|
@n3wscott I think that this may be deliberate: var result protocol.Result
if resp.StatusCode/100 == 2 {
result = protocol.ResultACK
} else {
result = protocol.ResultNACK
} then later if !protocol.IsACK(err) {
return nil, err
} but doesn't that go against spec |
in the case of the above event and the caller code of:
I would expect |
YES, it is a simple fix.. 😅 one sec |
Thanks for the bug @matejvasek !! The simple fix is this: https://github.com/cloudevents/sdk-go/pull/559/files#diff-4fd5b8ce98982998f08e4be1a9c74c50R152 Give it a try locally and see if it solves your issue. |
Sorry for late reply. Thanks @n3wscott , it works! |
Spec states
Events can be also be transferred in HTTP responses and with all HTTP status codes that permit payload body transfers.
However when I do request that results in 500:only error is set (correctly to "500:"), the
receivedEvt
is nil, despite the fact that response contained body with CloudEvent.The text was updated successfully, but these errors were encountered: