Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.3.3 #90

Merged
merged 2 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mummy.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.3.2"
version = "0.3.3"
author = "Ryan Oldenburg"
description = "Multithreaded HTTP + WebSocket server"
license = "MIT"
Expand Down
12 changes: 11 additions & 1 deletion src/mummy/multipart.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ proc decodeMultipart*(request: Request): seq[MultipartEntry] {.raises: [MummyErr
msg &= ", " & extra
raise newException(MummyError, move msg)

let first = request.headers["Content-Type"].split(';', maxsplit = 1)
var contentType = request.headers["Content-Type"]

# Wolfram HTTPClient in Wolfram Language uses a comma instead of
# a semicolon: multipart/form-data, boundary=vTd41rxm1e7O
if request.headers["User-Agent"].startsWith("Wolfram HTTPClient"):
contentType = contentType.replace(
"multipart/form-data,",
"multipart/form-data;"
)

let first = contentType.split(';', maxsplit = 1)

if cmpIgnoreCase(first[0], "multipart/form-data") != 0 or first.len != 2:
raiseInvalidContentType()
Expand Down