It seems that when this enum is turned into a JsValue that the properties are converted into strings as they are, so Get remains Get. This breaks the Express.js serve static middleware, as (IIRC) there is a conditional in there that looks at the method property of the request and compares it to GET. But unfortunately because of this enum the property is Get.
I believe that the request method should always have uppercase methods when converting from Rust to JS, at least that is how I have solved the problem in my work of wasmedge-quickjs.
I've been integrating Express in our environment and using wasmedge-quickjs. This enum is problematic: https://github.com/second-state/wasmedge-quickjs/blob/main/src/internal_module/httpx/core/mod.rs#L12
It seems that when this enum is turned into a JsValue that the properties are converted into strings as they are, so
Get
remainsGet
. This breaks the Express.js serve static middleware, as (IIRC) there is a conditional in there that looks at the method property of the request and compares it toGET
. But unfortunately because of this enum the property isGet
.I believe that the request method should always have uppercase methods when converting from Rust to JS, at least that is how I have solved the problem in my work of wasmedge-quickjs.