mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-04-29 07:25:24 +00:00
init coors for playt2.com
This commit is contained in:
parent
b1bf08267e
commit
43c15e1649
4 changed files with 98 additions and 2 deletions
87
app/webapp/config/cors.js
Normal file
87
app/webapp/config/cors.js
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Origin
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Set a list of origins to be allowed. The value can be one of the following
|
||||||
|
|
|
||||||
|
| Boolean: true - Allow current request origin
|
||||||
|
| Boolean: false - Disallow all
|
||||||
|
| String - Comma seperated list of allowed origins
|
||||||
|
| Array - An array of allowed origins
|
||||||
|
| String: * - A wildcard to allow current request origin
|
||||||
|
| Function - Receives the current origin and should return one of the above values.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
origin: ['playt2.com'],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Methods
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| HTTP methods to be allowed. The value can be one of the following
|
||||||
|
|
|
||||||
|
| String - Comma seperated list of allowed methods
|
||||||
|
| Array - An array of allowed methods
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
methods: ['GET', 'PUT', 'POST', 'OPTIONS', 'HEAD'],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Headers
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| List of headers to be allowed via Access-Control-Request-Headers header.
|
||||||
|
| The value can be on of the following.
|
||||||
|
|
|
||||||
|
| Boolean: true - Allow current request headers
|
||||||
|
| Boolean: false - Disallow all
|
||||||
|
| String - Comma seperated list of allowed headers
|
||||||
|
| Array - An array of allowed headers
|
||||||
|
| String: * - A wildcard to allow current request headers
|
||||||
|
| Function - Receives the current header and should return one of the above values.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
headers: true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Expose Headers
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| A list of headers to be exposed via `Access-Control-Expose-Headers`
|
||||||
|
| header. The value can be on of the following.
|
||||||
|
|
|
||||||
|
| Boolean: false - Disallow all
|
||||||
|
| String: Comma seperated list of allowed headers
|
||||||
|
| Array - An array of allowed headers
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
exposeHeaders: false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Credentials
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Define Access-Control-Allow-Credentials header. It should always be a
|
||||||
|
| boolean.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
credentials: false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MaxAge
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Define Access-Control-Max-Age
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
maxAge: 90
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="Access-Control-Allow-Origin" content="https://www.playt2.com"/>
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<title>Tribes 2 Stats</title>
|
<title>Tribes 2 Stats</title>
|
||||||
|
|
||||||
|
|
@ -49,6 +48,12 @@
|
||||||
function closePopUp(){
|
function closePopUp(){
|
||||||
document.getElementById("popup").remove();
|
document.getElementById("popup").remove();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(top != self){
|
||||||
|
setInterval(() => {
|
||||||
|
parent.postMessage(document.getElementById('app').clientHeight, '*');
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ const providers = [
|
||||||
'@adonisjs/framework/providers/AppProvider',
|
'@adonisjs/framework/providers/AppProvider',
|
||||||
'@adonisjs/framework/providers/ViewProvider',
|
'@adonisjs/framework/providers/ViewProvider',
|
||||||
'@adonisjs/lucid/providers/LucidProvider',
|
'@adonisjs/lucid/providers/LucidProvider',
|
||||||
|
'@adonisjs/cors/providers/CorsProvider',
|
||||||
'inertia-adonis/providers/InertiaProvider'
|
'inertia-adonis/providers/InertiaProvider'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,7 @@ const namedMiddleware = {}
|
||||||
Server
|
Server
|
||||||
.registerGlobal(globalMiddleware)
|
.registerGlobal(globalMiddleware)
|
||||||
.registerNamed(namedMiddleware)
|
.registerNamed(namedMiddleware)
|
||||||
.use(['Adonis/Middleware/Static'])
|
.use([
|
||||||
|
'Adonis/Middleware/Static',
|
||||||
|
'Adonis/Middleware/Cors'
|
||||||
|
])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue