mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: live: remove cookie when anonymous
related #86 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -24,6 +24,8 @@ class AnonymityInterceptor extends Interceptor {
|
||||
Api.dynamicDetail,
|
||||
Api.aiConclusion,
|
||||
Api.getSeasonDetailApi,
|
||||
Api.liveRoomDmToken,
|
||||
Api.liveRoomDmPrefetch,
|
||||
];
|
||||
|
||||
@override
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:PiliPalaX/pages/mine/controller.dart';
|
||||
import 'package:PiliPalaX/services/loggeer.dart';
|
||||
import 'package:brotli/brotli.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -190,7 +191,10 @@ class LiveMessageStream {
|
||||
Future<WebSocket> getSocket() async {
|
||||
for (final server in servers) {
|
||||
try {
|
||||
return await WebSocket.connect(server);
|
||||
return await WebSocket.connect(
|
||||
server,
|
||||
headers: MineController.anonymity.value ? {'cookie': ''} : null,
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
throw Exception("all servers connect failed");
|
||||
|
||||
Reference in New Issue
Block a user