mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 12:24:25 +02:00
Support up to 2mb requests
This commit is contained in:
@@ -17,7 +17,7 @@ app.use Metrics.http.monitor(logger)
|
||||
|
||||
app.get '/project/:project_id/doc', HttpController.getAllDocs
|
||||
app.get '/project/:project_id/doc/:doc_id', HttpController.getDoc
|
||||
app.post '/project/:project_id/doc/:doc_id', bodyParser.json(), HttpController.updateDoc
|
||||
app.post '/project/:project_id/doc/:doc_id', bodyParser.json(limit: "2mb"), HttpController.updateDoc
|
||||
app.del '/project/:project_id/doc/:doc_id', HttpController.deleteDoc
|
||||
|
||||
app.get '/status', (req, res)->
|
||||
|
||||
@@ -95,3 +95,19 @@ describe "Applying updates to a doc", ->
|
||||
doc.lines.should.deep.equal @originalLines
|
||||
done()
|
||||
|
||||
describe "when the content is large", ->
|
||||
beforeEach (done) ->
|
||||
line = new Array(1025).join("x") # 1kb
|
||||
@largeLines = Array.apply(null, Array(1024)).map(() -> line) # 1mb
|
||||
DocstoreClient.updateDoc @project_id, @doc_id, @largeLines, @newVersion, (error, res, @body) =>
|
||||
done()
|
||||
|
||||
it "should return modified = true", ->
|
||||
@body.modified.should.equal true
|
||||
|
||||
it "should update the doc in the API", (done) ->
|
||||
DocstoreClient.getDoc @project_id, @doc_id, (error, res, doc) =>
|
||||
doc.lines.should.deep.equal @largeLines
|
||||
doc.version.should.deep.equal @newVersion
|
||||
done()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user