Skip to content

Commit e8dff8d

Browse files
committed
refactor how Content-Type headers are checked
1 parent 99522c4 commit e8dff8d

15 files changed

Lines changed: 47 additions & 39 deletions

controllers/bulk.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { newID, isValidID, db } from '../database/index.js'
10-
import utils from '../utils.js'
11-
import { _contextid, ObjectID, createExpressError, getAgentClaim, parseDocumentID, idNegotiation } from './utils.js'
10+
import utils, { createExpressError } from '../utils.js'
11+
import { _contextid, ObjectID, getAgentClaim, parseDocumentID, idNegotiation } from './utils.js'
1212

1313
/**
1414
* Create many objects at once with the power of MongoDB bulkWrite() operations.

controllers/crud.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @author Claude Sonnet 4, cubap, thehabes
66
*/
77
import { newID, isValidID, db } from '../database/index.js'
8-
import utils from '../utils.js'
9-
import { _contextid, idNegotiation, generateSlugId, ObjectID, createExpressError, getAgentClaim, parseDocumentID } from './utils.js'
8+
import utils, { createExpressError } from '../utils.js'
9+
import { _contextid, idNegotiation, generateSlugId, ObjectID, getAgentClaim, parseDocumentID } from './utils.js'
1010

1111
/**
1212
* Create a new Linked Open Data object in RERUM v1.

controllers/delete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @author Claude Sonnet 4, cubap, thehabes
66
*/
77
import { newID, isValidID, db } from '../database/index.js'
8-
import utils from '../utils.js'
9-
import { createExpressError, getAgentClaim, parseDocumentID, getAllVersions, getAllDescendants } from './utils.js'
8+
import utils, { createExpressError } from '../utils.js'
9+
import { getAgentClaim, parseDocumentID, getAllVersions, getAllDescendants } from './utils.js'
1010

1111
/**
1212
* Mark an object as deleted in the database.

controllers/gog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { newID, isValidID, db } from '../database/index.js'
10-
import utils from '../utils.js'
11-
import { _contextid, ObjectID, createExpressError, getAgentClaim, parseDocumentID, idNegotiation } from './utils.js'
10+
import utils, { createExpressError } from '../utils.js'
11+
import { _contextid, ObjectID, getAgentClaim, parseDocumentID, idNegotiation } from './utils.js'
1212

1313
/**
1414
* THIS IS SPECIFICALLY FOR 'Gallery of Glosses'

controllers/history.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { newID, isValidID, db } from '../database/index.js'
10-
import utils from '../utils.js'
11-
import { _contextid, ObjectID, createExpressError, getAgentClaim, parseDocumentID, idNegotiation, getAllVersions, getAllAncestors, getAllDescendants } from './utils.js'
10+
import utils, { createExpressError } from '../utils.js'
11+
import { _contextid, ObjectID, getAgentClaim, parseDocumentID, idNegotiation, getAllVersions, getAllAncestors, getAllDescendants } from './utils.js'
1212

1313
/**
1414
* Public facing servlet to gather for all versions downstream from a provided `key object`.

controllers/overwrite.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { newID, isValidID, db } from '../database/index.js'
10-
import utils from '../utils.js'
11-
import { _contextid, ObjectID, createExpressError, getAgentClaim, parseDocumentID, idNegotiation } from './utils.js'
10+
import utils, { createExpressError } from '../utils.js'
11+
import { _contextid, ObjectID, getAgentClaim, parseDocumentID, idNegotiation } from './utils.js'
1212

1313
/**
1414
* Replace some existing object in MongoDB with the JSON object in the request body.

controllers/patchSet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { newID, isValidID, db } from '../database/index.js'
10-
import utils from '../utils.js'
11-
import { _contextid, ObjectID, createExpressError, getAgentClaim, parseDocumentID, idNegotiation, alterHistoryNext } from './utils.js'
10+
import utils, { createExpressError } from '../utils.js'
11+
import { _contextid, ObjectID, getAgentClaim, parseDocumentID, idNegotiation, alterHistoryNext } from './utils.js'
1212

1313
/**
1414
* Update some existing object in MongoDB by adding the keys from the JSON object in the request body.

controllers/patchUnset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { newID, isValidID, db } from '../database/index.js'
10-
import utils from '../utils.js'
11-
import { _contextid, ObjectID, createExpressError, getAgentClaim, parseDocumentID, idNegotiation, alterHistoryNext } from './utils.js'
10+
import utils, { createExpressError } from '../utils.js'
11+
import { _contextid, ObjectID, getAgentClaim, parseDocumentID, idNegotiation, alterHistoryNext } from './utils.js'
1212

1313
/**
1414
* Update some existing object in MongoDB by removing the keys noted in the JSON object in the request body.

controllers/patchUpdate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { newID, isValidID, db } from '../database/index.js'
10-
import utils from '../utils.js'
11-
import { _contextid, ObjectID, createExpressError, getAgentClaim, parseDocumentID, idNegotiation, alterHistoryNext } from './utils.js'
10+
import utils, { createExpressError } from '../utils.js'
11+
import { _contextid, ObjectID, getAgentClaim, parseDocumentID, idNegotiation, alterHistoryNext } from './utils.js'
1212

1313
/**
1414
* Update some existing object in MongoDB by changing the keys from the JSON object in the request body.

controllers/putUpdate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { newID, isValidID, db } from '../database/index.js'
10-
import utils from '../utils.js'
11-
import { _contextid, ObjectID, createExpressError, getAgentClaim, parseDocumentID, idNegotiation, alterHistoryNext } from './utils.js'
10+
import utils, { createExpressError } from '../utils.js'
11+
import { _contextid, ObjectID, getAgentClaim, parseDocumentID, idNegotiation, alterHistoryNext } from './utils.js'
1212

1313
/**
1414
* Replace some existing object in MongoDB with the JSON object in the request body.

0 commit comments

Comments
 (0)