1. John Wright
  2. Frontfax

Commits

John Wright  committed 0d98252

Fixed CSS/JS proxying

  • Participants
  • Parent commits 0bca5ea
  • Branches master

Comments (0)

Files changed (1)

File src/app/controllers/proxy.coffee

View file
  • Ignore whitespace
 	(req, res)->
 		requestUrl = url + req.originalUrl
 		match      = path.extname(req.path).match /html|js|css$/
+		html       = path.extname(req.path).match /html$/
+
+		res.header 'proxied', true
 
 		if req.method is 'GET' and match?
 			req.headers['accept-encoding'] = ''
-			res.header 'proxied', true
 			req.pipe request requestUrl, (err, proxyRes, body)->
-				body = socket.addClientCode body
-				res.type match.toString()
+				if html?
+					body = socket.addClientCode body
+					res.type match.toString()
 				res.send body
 
 		else