mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-20 06:01:12 -06:00
20 lines
465 B
CoffeeScript
20 lines
465 B
CoffeeScript
socketIo = require("@packages/socket")
|
|
|
|
## hold onto the client source + version in memory
|
|
clientSource = socketIo.getClientSource()
|
|
clientVersion = socketIo.getClientVersion()
|
|
|
|
module.exports = {
|
|
handle: (req, res) ->
|
|
etag = req.get("if-none-match")
|
|
|
|
if etag and (etag is clientVersion)
|
|
res.sendStatus(304)
|
|
else
|
|
res
|
|
.type("application/javascript")
|
|
.set("ETag", clientVersion)
|
|
.status(200)
|
|
.send(clientSource)
|
|
}
|