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

Implement the correct method in the server_connection #78

Merged
merged 4 commits into from
Apr 2, 2024
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
3 changes: 3 additions & 0 deletions .release-notes/78.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Rename upgrade to upgrade_protocol

To allow changing the TCP handler of a running HTTP connection, `Session` specifies a method `upgrade_protocol`, which should be implemented by the concrete classes. The implementation used by the actual HTTP server had an implementation for this feature, but the method was called `upgrade`. As `Session` provides a default implementation for `upgrade_protocol`, this wasn't caught. By renaming the implementation it's now possible to use the new feature to change the handler to a custom handler to handle for example WebSocket connections.
2 changes: 1 addition & 1 deletion http_server/_server_connection.pony
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,6 @@ actor _ServerConnection is (Session & HTTP11RequestHandler)
dispose()
end

be upgrade(notify: TCPConnectionNotify iso) =>
be upgrade_protocol(notify: TCPConnectionNotify iso) =>
_conn.set_notify(consume notify)

Loading