Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c1eefdb

Browse files
committedJul 16, 2019
Expose headers
1 parent 0127ab3 commit c1eefdb

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
 

‎app.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ const fileUpload = require('express-fileupload')
1717
// setup express app
1818
const app = express()
1919

20-
app.use(cors())
20+
app.use(cors({
21+
exposedHeaders: [
22+
'X-Prev-Page',
23+
'X-Next-Page',
24+
'X-Page',
25+
'X-Per-Page',
26+
'X-Total',
27+
'X-Total-Pages',
28+
'Link'
29+
]
30+
}))
2131
app.use(fileUpload({
2232
limits: { fileSize: config.FILE_UPLOAD_SIZE_LIMIT }
2333
}))

‎src/common/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ async function ensureProjectExist (projectId, userToken) {
519519
await axios.get(url, { headers: { Authorization: `Bearer ${token}` } })
520520
}
521521
} catch (err) {
522-
if (err.response.status === 404) {
522+
if (_.get(err.response.status) === 404) {
523523
throw new errors.BadRequestError(`Project with id: ${projectId} doesn't exist`)
524524
} else {
525525
// re-throw other error

0 commit comments

Comments
 (0)
Please sign in to comment.