mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #19293 from overleaf/jpa-issue-19290-2
[clsi] fix parsing of the requested file in symlink validation GitOrigin-RevId: 86cfe8d62bb99ed6844faee0ff4af507e571e04d
This commit is contained in:
@@ -94,6 +94,23 @@ describe('StaticServerForbidSymlinks', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('with a new line', function () {
|
||||
beforeEach(function () {
|
||||
this.req.url = '/12345/output.pdf\nother file'
|
||||
this.fs.realpath = sinon.stub().yields()
|
||||
})
|
||||
|
||||
it('should process the correct file', function (done) {
|
||||
this.res.sendStatus = () => {
|
||||
this.fs.realpath.should.have.been.calledWith(
|
||||
`${this.settings.path.compilesDir}/12345/output.pdf\nother file`
|
||||
)
|
||||
done()
|
||||
}
|
||||
this.StaticServerForbidSymlinks(this.req, this.res)
|
||||
})
|
||||
})
|
||||
|
||||
describe('with a symlink file', function () {
|
||||
beforeEach(function () {
|
||||
return (this.fs.realpath = sinon
|
||||
|
||||
Reference in New Issue
Block a user