Skip to content

Commit

Permalink
fix: exclude query params from auth (#1103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuyumi25 authored Nov 24, 2024
1 parent 0f451b0 commit 9d115c7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/popup/RSSItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ function RSSItem({
).replace(/\/$/, "")

if (type === "currentPageRSSHub" && config.rsshubAccessControl.accessKey) {
const urlObj = new URL(url)

if (config.rsshubAccessControl.accessKeyType === "key") {
url = `${url}?key=${config.rsshubAccessControl.accessKey}`
urlObj.searchParams.append('key', config.rsshubAccessControl.accessKey)
} else {
url = `${url}?code=${new MD5().update(item.path.replace(/\/$/, "") + config.rsshubAccessControl.accessKey).digest("hex")}`
const md5 = new MD5().update(urlObj.pathname + config.rsshubAccessControl.accessKey).digest("hex")
urlObj.searchParams.append('code', md5)
}

url = urlObj.toString()
}
if (type === "currentPageRSSHub") {
item.title = item.title.replace(
Expand Down

0 comments on commit 9d115c7

Please sign in to comment.