mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-27 11:21:19 +00:00
Fix bad scoping of user agent
This commit is contained in:
parent
34b53726d4
commit
cfc9dbdbb3
1 changed files with 7 additions and 4 deletions
|
@ -74,11 +74,10 @@ describe "FileStoreController", ->
|
||||||
describe "with a '#{extension}' file extension", ->
|
describe "with a '#{extension}' file extension", ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@user_agent = 'A generic browser'
|
|
||||||
@file.name = "bad#{extension}"
|
@file.name = "bad#{extension}"
|
||||||
@req.get = (key) =>
|
@req.get = (key) =>
|
||||||
if key == 'User-Agent'
|
if key == 'User-Agent'
|
||||||
@user_agent
|
return 'A generic browser'
|
||||||
|
|
||||||
describe "from a non-ios browser", ->
|
describe "from a non-ios browser", ->
|
||||||
|
|
||||||
|
@ -91,7 +90,9 @@ describe "FileStoreController", ->
|
||||||
describe "from an iPhone", ->
|
describe "from an iPhone", ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@user_agent = "An iPhone browser"
|
@req.get = (key) =>
|
||||||
|
if key == 'User-Agent'
|
||||||
|
return "An iPhone browser"
|
||||||
|
|
||||||
it "should set Content-Type to 'text/plain'", (done) ->
|
it "should set Content-Type to 'text/plain'", (done) ->
|
||||||
@stream.pipe = (des) =>
|
@stream.pipe = (des) =>
|
||||||
|
@ -102,7 +103,9 @@ describe "FileStoreController", ->
|
||||||
describe "from an iPad", ->
|
describe "from an iPad", ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@user_agent = "An iPad browser"
|
@req.get = (key) =>
|
||||||
|
if key == 'User-Agent'
|
||||||
|
return "An iPad browser"
|
||||||
|
|
||||||
it "should set Content-Type to 'text/plain'", (done) ->
|
it "should set Content-Type to 'text/plain'", (done) ->
|
||||||
@stream.pipe = (des) =>
|
@stream.pipe = (des) =>
|
||||||
|
|
Loading…
Add table
Reference in a new issue