@openneuro/server 4.44.2 → 4.44.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/server",
3
- "version": "4.44.2",
3
+ "version": "4.44.4",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -21,7 +21,7 @@
21
21
  "@elastic/elasticsearch": "8.13.1",
22
22
  "@graphql-tools/schema": "^10.0.0",
23
23
  "@keyv/redis": "^4.5.0",
24
- "@openneuro/search": "^4.44.2",
24
+ "@openneuro/search": "^4.44.4",
25
25
  "@sentry/node": "^8.25.0",
26
26
  "@sentry/profiling-node": "^8.25.0",
27
27
  "base64url": "^3.0.0",
@@ -89,5 +89,5 @@
89
89
  "publishConfig": {
90
90
  "access": "public"
91
91
  },
92
- "gitHead": "2df85aec35b3122c2be65627745569b914c56380"
92
+ "gitHead": "1f19e9260ba364a821864f48233e281507c0640a"
93
93
  }
package/src/app.ts CHANGED
@@ -39,6 +39,8 @@ interface OpenNeuroRequestContext {
39
39
  export async function expressApolloSetup() {
40
40
  const app = express()
41
41
 
42
+ app.set("trust proxy", true)
43
+
42
44
  setupPassportAuth()
43
45
 
44
46
  app.use(passport.initialize())
@@ -100,7 +100,9 @@ const postSnapshot = async (
100
100
  * @param {string} datasetId Dataset accession number
101
101
  * @returns {Promise<import('../models/snapshot').SnapshotDocument[]>}
102
102
  */
103
- export const getSnapshots = (datasetId): Promise<SnapshotDocument[]> => {
103
+ export const getSnapshots = async (datasetId): Promise<SnapshotDocument[]> => {
104
+ const dataset = await Dataset.findOne({ id: datasetId })
105
+ if (!dataset) return null
104
106
  const url = `${getDatasetWorker(datasetId)}/datasets/${datasetId}/snapshots`
105
107
  return request
106
108
  .get(url)