Skip to content

Commit

Permalink
bytesize
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorerlingsson committed Feb 12, 2024
1 parent d846205 commit dc45def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lavinmq/http/controller/vhosts.cr
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module LavinMQ
refuse_unless_administrator(context, u)
name = URI.decode_www_form(params["name"])
is_update = @amqp_server.vhosts[name]?
if name.size > 255
if name.bytesize > UInt8::MAX
bad_request(context, "Vhost name too long, can't exceed 255 characters")
end
@amqp_server.vhosts.create(name, u)
Expand Down

0 comments on commit dc45def

Please sign in to comment.