Skip to content

Commit

Permalink
(Bug): object failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kang49 committed Feb 23, 2024
1 parent 88243f9 commit fe82ec2
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 fe82ec2

Please sign in to comment.