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

Fixed websocket support in hs.httpserver:start() #3665

Merged
merged 2 commits into from
Nov 12, 2024
Merged
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
4 changes: 2 additions & 2 deletions extensions/httpserver/libhttpserver.m
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@
LuaSkin *skin = [LuaSkin sharedWithState:L];
HSHTTPServer *server = getUserData(L, 1);

if (server.fn == LUA_NOREF) {
[skin logError:@"hs.httpserver:start() called with no callback set. You must call hs.httpserver:setCallback() first"];
if (server.fn == LUA_NOREF && server.wsCallback == LUA_NOREF) {
[skin logError:@"hs.httpserver:start() called with no callback set. You must call `hs.httpserver:setCallback()` or `hs.httpserver:websocket()` first."];

Check warning on line 587 in extensions/httpserver/libhttpserver.m

View check run for this annotation

Codecov / codecov/patch

extensions/httpserver/libhttpserver.m#L587

Added line #L587 was not covered by tests
} else {
NSError *error = nil;
if (![server start:&error]) {
Expand Down
Loading