Skip to content

Multipart name= without quotations doesn't work #1513

@hykilpikonna

Description

@hykilpikonna

What version of Elysia is running?

1.4.13

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What environment are you using

bun 1.2.21

Are you using dynamic mode?

No

What steps can reproduce the bug?

  1. Send a multipart packet which name= doesn't have quotation marks (which https://github.com/ktorio/ktor does)
  2. elysia will think it's null

I checked the RFC7578 standard, and it didn't mention whether quotation marks are needed, so maybe add support for non-quoted name=?

What is the expected behavior?

No response

What do you see instead?

Image

Additional information

Packet capture

JS Fetch FormData

POST /upload HTTP/1.1
x-instant-key: meowmeow
Content-Type: multipart/form-data; boundary=-WebkitFormBoundary074b68ff41eb4ad0bc81501198ed9954
Connection: keep-alive
User-Agent: Bun/1.2.21
Accept: */*
Host: localhost:3000
Accept-Encoding: gzip, deflate, br, zstd
Content-Length: 9409403

---WebkitFormBoundary074b68ff41eb4ad0bc81501198ed9954
Content-Disposition: form-data; name="id"

test-252
---WebkitFormBoundary074b68ff41eb4ad0bc81501198ed9954
Content-Disposition: form-data; name="owner_key"

1234
---WebkitFormBoundary074b68ff41eb4ad0bc81501198ed9954
Content-Disposition: form-data; name="photo"; filename="./UWU01721.JPG"
Content-Type: application/octet-stream

�����AExif

Ktor

POST /upload HTTP/1.1
Host: 172.16.0.212:3000
Content-Length: 14279723
x-instant-key: meowmeow
Accept: application/json
Accept-Charset: UTF-8
User-Agent: ktor-client
Content-Type: multipart/form-data; boundary=-748f4c8e-19eb394f-6d6c679e-74278686658a4a8c701fae79636dfd85372e904c-4

---748f4c8e-19eb394f-6d6c679e-74278686658a4a8c701fae79636dfd85372e904c-4
Content-Disposition: form-data; name=id
Content-Length: 36

e662d915-3ed6-4042-baca-861630ab65bc
---748f4c8e-19eb394f-6d6c679e-74278686658a4a8c701fae79636dfd85372e904c-4
Content-Disposition: form-data; name=owner_key
Content-Length: 4

1234
---748f4c8e-19eb394f-6d6c679e-74278686658a4a8c701fae79636dfd85372e904c-4
Content-Disposition: form-data; name=photo; filename=UWU01955.JPG
Content-Type: image/jpeg
Content-Length: 14166893

���ῄExif

Have you try removing the node_modules and bun.lockb and try again yet?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions