mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Fixed issue with embedded player, and trying to get better error-logs
This commit is contained in:
		| @@ -73,8 +73,19 @@ app.get('/robots.txt', function (req, res) { | |||||||
|  |  | ||||||
| app.use(function (req, res, next) { | app.use(function (req, res, next) { | ||||||
| 	var cookie = req.cookies._uI; | 	var cookie = req.cookies._uI; | ||||||
|  | 	if(req.originalUrl.split("/").length > 3) { | ||||||
|  | 		res.header("Access-Control-Allow-Origin", "*"); | ||||||
|  | 	    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | ||||||
|  | 		next(); | ||||||
|  | 	} else { | ||||||
| 		if (cookie === undefined) { | 		if (cookie === undefined) { | ||||||
| 		console.error((new Date), "couldn't fetch cookie for some reason, maybe no cookie exists?", req, "couldn't fetch cookie for some reason, maybe no cookie exists?"); |             try { | ||||||
|  | 				console.error((new Date), "originalUrl", req.originalUrl); | ||||||
|  | 	            console.error((new Date), "couldn't fetch cookie for some reason, maybe no cookie exists?", req.get('origin'), "couldn't fetch cookie for some reason, maybe no cookie exists?"); | ||||||
|  |  | ||||||
|  | 			} catch(e) { | ||||||
|  |                 console.error((new Date), "couldn't fetch origin"); | ||||||
|  |             } | ||||||
|             var user_name = Functions.hash_pass(Functions.rndName(uniqid.time(), 15)); |             var user_name = Functions.hash_pass(Functions.rndName(uniqid.time(), 15)); | ||||||
| 			res.cookie('_uI', user_name, { | 			res.cookie('_uI', user_name, { | ||||||
| 	            maxAge: 365 * 10000 * 3600000, | 	            maxAge: 365 * 10000 * 3600000, | ||||||
| @@ -94,6 +105,7 @@ app.use(function (req, res, next) { | |||||||
| 		res.header("Access-Control-Allow-Origin", "*"); | 		res.header("Access-Control-Allow-Origin", "*"); | ||||||
| 	    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | 	    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | ||||||
| 		next(); | 		next(); | ||||||
|  | 	} | ||||||
| }); | }); | ||||||
|  |  | ||||||
| app.use('/service-worker.js', function(req, res) { | app.use('/service-worker.js', function(req, res) { | ||||||
|   | |||||||
| @@ -3432,10 +3432,9 @@ nav ul li:hover, nav ul li.active { | |||||||
|  |  | ||||||
|     .title-container{ |     .title-container{ | ||||||
|         background-color: rgba(0,0,0,0.1); |         background-color: rgba(0,0,0,0.1); | ||||||
|         display: inline-block; |         display: block; | ||||||
|         top:56px !important; |         top:56px !important; | ||||||
|         width: 100vw; |         width: 100vw; | ||||||
|  |  | ||||||
|         background: #2d2d2d; |         background: #2d2d2d; | ||||||
|     } |     } | ||||||
|     .title-container li { |     .title-container li { | ||||||
|   | |||||||
| @@ -566,7 +566,7 @@ var Player = { | |||||||
|             //var elem          = document.getElementById('song-title'); |             //var elem          = document.getElementById('song-title'); | ||||||
|             //var getTitleViews = document.getElementById('viewers'); |             //var getTitleViews = document.getElementById('viewers'); | ||||||
|  |  | ||||||
|             if(!client) { |             if(!client && !embed) { | ||||||
|                 document.getElementById("host-title").innerText = title; |                 document.getElementById("host-title").innerText = title; | ||||||
|             } |             } | ||||||
|             document.getElementById("song-title").innerText = title; |             document.getElementById("song-title").innerText = title; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user