Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Commit 91a83e7

Browse files
committed
Version bump
1 parent 71ef05d commit 91a83e7

File tree

4 files changed

+196
-359
lines changed

4 files changed

+196
-359
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "raven-reader",
33
"productName": "Raven Reader",
4-
"version": "1.0.51",
4+
"version": "1.0.52",
55
"author": "Hello Efficiency Inc. <[email protected]>",
66
"description": "Simple desktop RSS Reader",
77
"license": "MIT",
@@ -104,6 +104,7 @@
104104
"jquery": "3.6.0",
105105
"electron-icon-builder/**/yargs-parser": "13.1.2",
106106
"@postlight/mercury-parser/jquery": "3.5.0",
107-
"vue-cli-plugin-electron-builder/**/minimist": "0.2.1"
107+
"vue-cli-plugin-electron-builder/**/minimist": "0.2.1",
108+
"vue-cli-plugin-electron-builder/electron-builder": "22.10.4"
108109
}
109110
}

src/bridge/rss.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import RssParser from 'rss-parser'
22
import rssFinder from 'rss-finder'
33
import normalizeUrl from 'normalize-url'
4+
import {
5+
validate
6+
} from 'fast-xml-parser'
7+
import fetch from 'node-fetch'
48

59
const parser = new RssParser({
610
requestOptions: {
@@ -21,6 +25,17 @@ const parser = new RssParser({
2125
})
2226

2327
export default {
28+
async checkXml (link) {
29+
const content = await fetch(link, {
30+
cors: 'no-cors',
31+
referrer: '',
32+
credentials: 'omit',
33+
redirect: 'follow'
34+
})
35+
const data = await content.text()
36+
const validateXml = validate(data)
37+
return validateXml === true
38+
},
2439
async parseRssUrl (url) {
2540
return await parser.parseURL(url)
2641
},

src/components/SubscribeModal.vue

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
<script>
117117
import normalizeUrl from 'normalize-url'
118118
import unescape from '../services/unescape'
119-
import { validate } from 'fast-xml-parser'
120119
import helper from '../services/helpers'
121120
122121
export default {
@@ -156,22 +155,13 @@ export default {
156155
addCategory () {
157156
this.showAddCat = !this.showAddCat
158157
},
159-
async isContentXML (link) {
160-
const content = await fetch(link, {
161-
mode: 'no-cors',
162-
redirect: 'follow'
163-
})
164-
const data = await content.text()
165-
const validateXml = validate(data)
166-
return validateXml === true
167-
},
168158
async fetchFeed () {
169159
const self = this
170160
this.loading = true
171161
if (!this.$store.state.Setting.offline) {
172162
if (this.feed_url) {
173163
try {
174-
const isXML = await this.isContentXML(normalizeUrl(this.feed_url, { stripWWW: false, removeTrailingSlash: false }))
164+
const isXML = await window.rss.checkXml(normalizeUrl(this.feed_url, { stripWWW: false, removeTrailingSlash: false }))
175165
window.rss.findRss(this.feed_url).then(
176166
res => {
177167
this.loading = false

0 commit comments

Comments
 (0)