mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Support up to 2mb requests
This commit is contained in:
parent
0dda75c2d5
commit
79457227e1
2 changed files with 17 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue