Skip to content

Commit

Permalink
If no URL is provided in our body, return a 400 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
oo-bldrs authored Aug 27, 2023
1 parent 7a2b5ae commit f7a7dde
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ app.post('/render', async (req, res) => {
const camera = initCamera(45, aspect)
initLights(scene)

// Get the model URL, if none provided, return a 400 Bad Request
let ifcURL = req.body.url
if (ifcURL === undefined) {
res.status(400).send()
}

let coordinates = []
const url = new URL(ifcURL)
if (url.hostname === 'bldrs.ai') {
Expand Down

0 comments on commit f7a7dde

Please sign in to comment.