teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

微修正

2020/09/28 04:43

投稿

azot2
azot2

スコア3

title CHANGED
File without changes
body CHANGED
@@ -23,11 +23,13 @@
23
23
 
24
24
  Routingは以下の通りです。
25
25
  元はpostのみだったのですが、Redirectするにあたり、getとなってしまうため、以下のように変えました。
26
- ```Route::match(['get','post'],'User/show', 'UpdateController@show');
27
26
  ```
27
+ Route::match(['get','post'],'User/show', 'UpdateController@show');
28
+ ```
28
29
 
29
30
  クリックジャッキング対策として、以下middlewareを追加しています。
30
31
  その他に、通常のMVC関連以外のファイルは作成していません。
32
+
31
33
  ```
32
34
  class AddXFrameOptions
33
35
  {

1

middlewareについて、追記

2020/09/28 04:43

投稿

azot2
azot2

スコア3

title CHANGED
File without changes
body CHANGED
@@ -24,4 +24,18 @@
24
24
  Routingは以下の通りです。
25
25
  元はpostのみだったのですが、Redirectするにあたり、getとなってしまうため、以下のように変えました。
26
26
  ```Route::match(['get','post'],'User/show', 'UpdateController@show');
27
+ ```
28
+
29
+ クリックジャッキング対策として、以下middlewareを追加しています。
30
+ その他に、通常のMVC関連以外のファイルは作成していません。
31
+ ```
32
+ class AddXFrameOptions
33
+ {
34
+ public function handle($request, Closure $next)
35
+ {
36
+ $response = $next($request);
37
+ $response->headers->set('X-Frame-Options', 'deny');
38
+ return $response;
39
+ }
40
+ }
27
41
  ```