Skip to content

Commit ee0ccda

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 68f551b + 2279ca9 commit ee0ccda

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ Contributors:
1414
[@Frederikam](https://github.com/Frederikam/),
1515
[@calebj](https://github.com/calebj)
1616

17+
## v3.1.2
18+
* Add API version header to all responses
19+
20+
Contributor:
21+
[@Devoxin](https://github.com/Devoxin)
22+
23+
## v3.1.1
24+
* Add equalizer support
25+
26+
Contributor:
27+
[@Devoxin](https://github.com/Devoxin)
28+
1729
## v3.1
1830
* Replaced JDAA with Magma
1931
* Added an event for when the Discord voice WebSocket is closed

IMPLEMENTATION.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ Additionally, in every `/loadtracks` response, a `loadType` property is returned
307307
* `NO_MATCHES` - Returned if no matches/sources could be found for a given identifier.
308308
* `LOAD_FAILED` - Returned if Lavaplayer failed to load something for some reason.
309309

310+
All REST responses from Lavalink include a `Lavalink-Api-Version` header.
311+
310312
### Special notes
311313
* When your shard's mainWS connection dies, so does all your lavalink audio connections.
312314
* This also includes resumes
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package lavalink.server.io;
2+
3+
import org.springframework.stereotype.Component;
4+
import org.springframework.web.filter.OncePerRequestFilter;
5+
6+
import javax.servlet.FilterChain;
7+
import javax.servlet.ServletException;
8+
import javax.servlet.http.HttpServletRequest;
9+
import javax.servlet.http.HttpServletResponse;
10+
import java.io.IOException;
11+
12+
@Component
13+
public class ResponseHeaderFilter extends OncePerRequestFilter {
14+
15+
@Override
16+
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
17+
FilterChain filterChain) throws IOException, ServletException {
18+
response.addHeader("Lavalink-Api-Version", "3");
19+
filterChain.doFilter(request, response);
20+
}
21+
}

0 commit comments

Comments
 (0)