Skip to content

Commit

Permalink
Merge pull request #12 from kang49/develop
Browse files Browse the repository at this point in the history
(Bug): object failure
  • Loading branch information
kang49 authored Feb 23, 2024
2 parents 416a036 + fe82ec2 commit 27f1d6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ app.use((req, res, next) => {

// API Route
app.get(/\/api$/, async (req, res) => {
let biliLink
let biliLink;

if (req.headers.bililink) {
biliLink = req.headers.bililink;
} else {
biliLink = req.body.biliLink ?? req.query ?? req.headers.bililink
biliLink = req.body.biliLink || req.query.biliLink || '';
}

// Convert to string
var BiliLink = biliLink?.toString() || '';
BiliLink = BiliLink.replace('%20', ' ');
var BiliLink = String(biliLink || '').replace('%20', ' ');
console.log(BiliLink);

const linkRegex = /(https?:\/\/[^\s]+)/;
Expand Down

0 comments on commit 27f1d6b

Please sign in to comment.