mirror of
https://codeberg.org/tacerus/teddit.git
synced 2025-01-07 20:02:32 +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', () => {
|
||||
body = body.toString()
|
||||
let json = body.split('Content-Type: application/json')[1].trim().split('--')[0]
|
||||
try {
|
||||
let json = body.split('Content-Type: application/json')[1].trim().split('--')[0]
|
||||
let prefs = JSON.parse(json)
|
||||
resetPreferences(res)
|
||||
for(var setting in prefs) {
|
||||
|
Loading…
Reference in New Issue
Block a user