fastify / fastify-cors

Fastify CORS
MIT License
414 stars 57 forks source link

Options Request Returns 404 running in bun #279

Closed Chrysochrome closed 10 months ago

Chrysochrome commented 10 months ago

Prerequisites

Fastify version

4.24.3

Plugin version

8.4.1

Node.js version

20.x

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

macOS 14.0 (23A344)

Description

Hello,

I've encountered an issue with @fastify/cors when running under bun. Specifically, the library fails to mount OPTIONS requests, which results in a 404 error.

I've created a minimal reproducible example in this repository: https://github.com/Chrysochrome/fastify-bun-bug

Actual behavior: The server returns a 404 error.

I believe this is a bug in @fastify/cors and would appreciate any assistance in resolving this issue.

Thank you for your time and consideration.

Steps to Reproduce

  1. Clone the repository
  2. Install dependencies with npm install
  3. Follow the README.md
  4. Send an OPTIONS request use npm run run:test

Expected Behavior

The server should respond to the OPTIONS request without any errors.

jsumners commented 10 months ago

Thank you for the report. This project targets the Node.js runtime. If you are encountering issues using Bun, please file issues there as requested by them.