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

If fnReturn.body is CloudEvent, we should return CloudEvent's data as response body instead of the whole CloudEvent as response body #218

Open
xqianwang opened this issue Apr 10, 2023 · 1 comment

Comments

@xqianwang
Copy link

xqianwang commented Apr 10, 2023

When we define the response headers in StructuredReturn, the whole CloudEvent is returned as response body instead of the CloudEvent's data.

curl -X POST -d '{"hello": "world"}' \
  -H'Content-type: application/json' \
    -H 'Ce-Id: asdadadsada' \
    -H 'Ce-type: user-request' \
    -H 'Ce-specversion: 1.0' \
    -H 'Ce-correlationid: 123' \
    -H 'Ce-mode: SYNC' \
    -H 'Ce-Source: nodejs' \
    http://localhost:8080

expected: {"hello":"world"}

actual: {"id":"asdadadsada","time":"2023-04-10T03:50:12.135Z","type":"user-request","source":"nodejs","specversion":"1.0","datacontenttype":"application/json","data":{"hello":"world"},"correlationid":"123","mode":"SYNC"}

@lance
Copy link
Member

lance commented May 10, 2023

@xqianwang can you please provide the function that you are using to generate this response?

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

No branches or pull requests

2 participants