Skip to content

Commit

Permalink
fix: unlimit longer access_key again & refine ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cxw620 authored Sep 18, 2023
2 parents c63b55e + f608707 commit 5ae4646
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,22 @@ jobs:
uses: actions/download-artifact@v3
with:
name: biliroaming-rust-server-${{ github.run_number }}
- name: Delete old release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: alpha-releases
assets: |
biliroaming_rust_server
- name: Release
uses: softprops/action-gh-release@v1
- name: Update Alpha Release
uses: mini-bomba/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
tag_name: alpha-releases
tag: alpha-releases
name: Alpha-Release
body: |
This automatic prerelease is built from commit ${{ env.GIT_HASH }} and was triggered by @${{ github.actor }}
[Github Actions workflow run that built this prerelease](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
Commit message:
${{ env.GIT_MESSAGE }}
files: |
./biliroaming_rust_server
clear_attachments: true

release:
name: Upload the binary file when it is released
Expand Down
6 changes: 4 additions & 2 deletions src/mods/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ pub async fn handle_search_request(req: &HttpRequest, is_app: bool, is_th: bool)
// detect user's access_key
params.access_key = match query.get("access_key") {
Some(key) => {
if key.len() != 32 && key.len() != 107 {
if key.len() < 32 {
error!("[GET SEARCH] IP {client_ip} -> Detect req with invalid access_key {key}");
build_response!(EType::UserNotLoginedError);
} else {
key.split_at(32).0
Expand Down Expand Up @@ -614,7 +615,8 @@ pub async fn handle_th_season_request(
// detect user's access_key
params.access_key = match query.get("access_key") {
Some(key) => {
if key.len() != 32 && key.len() != 107 {
if key.len() < 32 {
error!("[GET TH SEASON] IP {client_ip} -> Detect req with invalid access_key {key}");
build_response!(EType::UserNotLoginedError);
} else {
key.split_at(32).0
Expand Down

0 comments on commit 5ae4646

Please sign in to comment.