make getotheruser browser accessible (CORS)
This commit is contained in:
parent
285c31d58b
commit
35df3913da
@ -374,7 +374,7 @@ router.options("/api/getotheruser",async function(req,res,next) {
|
|||||||
|
|
||||||
router.use("/api/*",async function(req,res,next) {
|
router.use("/api/*",async function(req,res,next) {
|
||||||
res.set("Access-Control-Allow-Origin","*") //we'll allow it for now
|
res.set("Access-Control-Allow-Origin","*") //we'll allow it for now
|
||||||
if(config["allow_getotheruser_without_cookie"] && req.url == "/api/getotheruser") {
|
if(config["allow_getotheruser_without_cookie"] && req.originalUrl.split("\?")[0] == "/api/getotheruser") {
|
||||||
next()
|
next()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -506,7 +506,7 @@ router.get("/api/getalluserinformation",async function(req,res) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
router.get("/api/getotheruser",async function(req,res) {
|
router.get("/api/getotheruser",async function(req,res) {
|
||||||
res.set("Access-Control-Allow-Origin","")
|
res.set("Access-Control-Allow-Origin","*")
|
||||||
let username = req.query.user
|
let username = req.query.user
|
||||||
|
|
||||||
let sql = `select User_Name,User_Bio,User_Avatar from zerotwohub.users where User_Name=?;`
|
let sql = `select User_Name,User_Bio,User_Avatar from zerotwohub.users where User_Name=?;`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user