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

SetHttpHandler Crash: response functions [bad_cast] #3045

Open
TheGamerzs opened this issue Dec 28, 2024 · 0 comments
Open

SetHttpHandler Crash: response functions [bad_cast] #3045

TheGamerzs opened this issue Dec 28, 2024 · 0 comments
Labels
bug crash triage Needs a preliminary assessment to determine the urgency and required action

Comments

@TheGamerzs
Copy link
Contributor

TheGamerzs commented Dec 28, 2024

What happened?

The server crashes when the response functions are passed with arguments that are not the expected argument type

C:\>curl http://localhost:30120/api/
curl: (52) Empty reply from server
terminate called after throwing an instance of 'msgpack::v1::type_error'
  what():  std::bad_cast

Expected result

send / write: cast nil, number, or table to a string
writeHead: should only accept [number, table | nil]
Ignore/Error on function

Reproduction steps

["/api/" - is the resource name]

SetHttpHandler(function(req, res)
    res.send(404)
 --res.write(nil)
 --res.writeHead(function() end)
end)

Importancy

Crash

Area(s)

FXServer

Specific version(s)

Server 12168

Additional information

Crashes with: nil, number, table, function

@TheGamerzs TheGamerzs added bug triage Needs a preliminary assessment to determine the urgency and required action labels Dec 28, 2024
@github-actions github-actions bot added the crash label Dec 28, 2024
@TheGamerzs TheGamerzs changed the title SetHttpHandler (LUA) response.send bad_cast Crash SetHttpHandler bad_cast Crash Dec 28, 2024
@TheGamerzs TheGamerzs changed the title SetHttpHandler bad_cast Crash SetHttpHandler response bad_cast Crash Dec 28, 2024
@TheGamerzs TheGamerzs changed the title SetHttpHandler response bad_cast Crash SetHttpHandler Crash: response functions [bad_cast] Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crash triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

1 participant