wing icon indicating copy to clipboard operation
wing copied to clipboard

`cloud.ApiRequest.body` is an empty string for GET requests

Open eladcon opened this issue 1 year ago • 5 comments

I tried this:

bring cloud;
bring http;

let api = new cloud.Api();
api.get("/", inflight (r) => {
  if let body = r.body {
    return {
      status: 500
    };
  } else {
    return {
      status: 200
    };
  }
});

test "" {
  let res = http.get(api.url);
  assert(res.status == 200);
}

This happened:

assertion failed: res.status == 200

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.

eladcon avatar May 26 '24 14:05 eladcon

+1

ekeren avatar May 26 '24 14:05 ekeren

Congrats! :rocket: This was released in Wing 0.74.20.

monadabot avatar May 28 '24 15:05 monadabot

It seems that AWS is treating both empty strings body and no body as the same - null body. Do we want to match this behavior? I'm not sure what's happening in other cloud providers.

eladcon avatar Jun 27 '24 09:06 eladcon

Since this is currently not blocking any user, I've lowered the priority to p3

staycoolcall911 avatar Jun 27 '24 13:06 staycoolcall911

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] avatar Sep 28 '24 06:09 github-actions[bot]