このコミットが含まれているのは:
テクニカル諏訪子 2018-02-09 14:45:13 +01:00
コミット f684a62a41
2個のファイルの変更13行の追加13行の削除

ファイルの表示

@ -20,10 +20,10 @@ class TrustProxies extends Middleware
* @var array * @var array
*/ */
protected $headers = [ protected $headers = [
Request::HEADER_FORWARDED => 'FORWARDED', // Request::HEADER_FORWARDED => 'FORWARDED',
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', // Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', // Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', // Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', // Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
]; ];
} }

ファイルの表示

@ -19,9 +19,9 @@ try {
* CSRF token as a header based on the value of the "XSRF" token cookie. * CSRF token as a header based on the value of the "XSRF" token cookie.
*/ */
window.axios = require('axios'); // window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/** /**
* Next we will register the CSRF Token as a common header with Axios so that * Next we will register the CSRF Token as a common header with Axios so that
@ -29,13 +29,13 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
* a simple convenience so we don't have to attach every token manually. * a simple convenience so we don't have to attach every token manually.
*/ */
let token = document.head.querySelector('meta[name="csrf-token"]'); // let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) { // if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; // window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else { // } else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); // console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
} // }
/** /**
* Echo exposes an expressive API for subscribing to channels and listening * Echo exposes an expressive API for subscribing to channels and listening