Skip to content

Commit

Permalink
Accept big payload for metadata_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
agix committed Nov 6, 2017
1 parent f12065c commit c1d5c8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const app = express();
app.server = http.createServer(app);

app.use(cors());
app.use(bodyParser.json());
app.use(bodyParser.json({limit: '100mb'}));

initializeDb(config, (couchdb, redis) => {
if (process.env.TEST_SERVER) {
Expand Down
1 change: 1 addition & 0 deletions src/routes/GetUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default ({ redis, couchdb }) => {
}

delete submitUser.options;
delete submitUser.metadataCache;
delete submitUser.keys;
delete submitUser.seed;
delete submitUser.rescueCodes;
Expand Down
6 changes: 5 additions & 1 deletion src/routes/UpdateUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ export default ({ couchdb, redis }) => {
typeof jsonBody.pass === 'undefined' ||
typeof jsonBody.privateKey === 'undefined'
) {
doc.user[req.params.name].options = jsonBody;
if (typeof jsonBody.options === 'undefined') {
doc.user[req.params.name].metadataCache = jsonBody;
} else {
doc.user[req.params.name].options = jsonBody;
}
} else {
const md = forge.md.sha256.create();
md.update(jsonBody.pass.hash);
Expand Down

0 comments on commit c1d5c8e

Please sign in to comment.