mirror of
https://codeberg.org/tacerus/teddit.git
synced 2025-01-08 12:22:33 +01:00
move body splitting inside try block
This commit is contained in:
parent
156c7ba40a
commit
24c55d8708
@ -1734,8 +1734,8 @@ module.exports = (app, redis, fetch, RedditAPI) => {
|
|||||||
})
|
})
|
||||||
req.on('end', () => {
|
req.on('end', () => {
|
||||||
body = body.toString()
|
body = body.toString()
|
||||||
let json = body.split('Content-Type: application/json')[1].trim().split('--')[0]
|
|
||||||
try {
|
try {
|
||||||
|
let json = body.split('Content-Type: application/json')[1].trim().split('--')[0]
|
||||||
let prefs = JSON.parse(json)
|
let prefs = JSON.parse(json)
|
||||||
resetPreferences(res)
|
resetPreferences(res)
|
||||||
for(var setting in prefs) {
|
for(var setting in prefs) {
|
||||||
|
Loading…
Reference in New Issue
Block a user