awslabs / llrt

LLRT (Low Latency Runtime) is an experimental, lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications.
Apache License 2.0
7.73k stars 341 forks source link

fix: get method does not return null #412

Closed nabetti1720 closed 3 weeks ago

nabetti1720 commented 3 weeks ago

Description of changes

In the get() method of the Headers object, undefined is returned when a non-existent key is specified.

% ./llrt -e "console.log(new Headers().get('aaa'));"
undefined

Normally, null should be returned.

https://developer.mozilla.org/en-US/docs/Web/API/Headers/get

The get() method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.