-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Lavalink Major Version Header #111
Changes from 5 commits
9088b86
4ce7ad7
c906902
77df2c0
ede5bdf
67b49c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,10 @@ | |
import net.dv8tion.jda.Core; | ||
import net.dv8tion.jda.manager.AudioManager; | ||
import org.java_websocket.WebSocket; | ||
import org.java_websocket.drafts.Draft; | ||
import org.java_websocket.exceptions.InvalidDataException; | ||
import org.java_websocket.handshake.ClientHandshake; | ||
import org.java_websocket.handshake.ServerHandshakeBuilder; | ||
import org.java_websocket.server.WebSocketServer; | ||
import org.json.JSONObject; | ||
import org.slf4j.Logger; | ||
|
@@ -76,6 +79,13 @@ public void start() { | |
super.start(); | ||
} | ||
|
||
@Override | ||
public ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer(WebSocket conn, Draft draft, ClientHandshake request) throws InvalidDataException { | ||
ServerHandshakeBuilder builder = super.onWebsocketHandshakeReceivedAsServer(conn, draft, request); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure super's method is not empty? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes i'm sure, it returns an empty handshake impl but it seems java websocket initializes it elsewhere. it returns all the necessary websocket headers as defined in the RFC, its own server name as well as the custom header i specified. i also printed out all the headers received in my own client which returned exactly what i described while using the branch here so i'm very sure it works. ^ that was the image i posted in the jda server of the initial commit just before i changed Lavalink-Version to Lavalink-Major-Version as per your request, using code in my client that really does just print out the provided headers from the handshake There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah fair enough, I didn't stop to consider the return value of it |
||
builder.put("Lavalink-Major-Version", "3"); | ||
return builder; | ||
} | ||
|
||
@Override | ||
public void onOpen(WebSocket webSocket, ClientHandshake clientHandshake) { | ||
try { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why we need an extra header. I would remove this and change "Breaking" to "Significant" in the other two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, you want me to just change "Non-breaking" to "Significant" then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh no sorry i gotcha, significant changes for v2 -> v3 and v1 -> v2 and then list em all without the need for an extra markdown header