Skip to content

Commit d73d57c

Browse files
committed
no content response fix (mc api)
1 parent e72b6d6 commit d73d57c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ app.use("/proxyCheck",(req,res,next)=>{
1515
app.get("/getId",(req,res,next)=>{
1616
axios.get(`https://api.mojang.com/users/profiles/minecraft/${req.query.nick}`,{responseType: 'json'})
1717
.then(function (response) {
18-
res.send(response.data.id)
18+
if(response.status==204){
19+
res.send('ERR')
20+
}else{
21+
res.send(response.data.id)
22+
}
1923
})
2024
.catch(function (error) {
2125
res.send("ERR")

0 commit comments

Comments
 (0)