Skip to content

Commit b6fc8b1

Browse files
committed
fix: 兼容 clash premium 返回的 204
1 parent 10631da commit b6fc8b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/skipper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void Skipper::skip() const {
3838
return;
3939
}
4040
if (int code = reply1->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
41-
code != 200) {
41+
code / 100 != 2) {
4242
SPDLOG_LOGGER_WARN(_logger, "Failed to get connection, http status code: {}", code);
4343
reply1->deleteLater();
4444
_logger->flush();
@@ -86,7 +86,7 @@ void Skipper::skip() const {
8686

8787
if (int code = reply2->
8888
attribute(QNetworkRequest::HttpStatusCodeAttribute).
89-
toInt(); code != 200) {
89+
toInt(); code / 100 != 2) {
9090
SPDLOG_LOGGER_WARN(
9191
_logger, "kill connection failed, http status code: {}", code);
9292
reply2->deleteLater();
@@ -120,7 +120,7 @@ void Skipper::test() {
120120
_logger->flush();
121121
return;
122122
}
123-
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) {
123+
if (int code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); code / 100 != 2) {
124124
SPDLOG_LOGGER_WARN(_logger, "Failed to get version, http status code: {}",
125125
reply->errorString().toStdString());
126126
reply->deleteLater();

0 commit comments

Comments
 (0)