回答編集履歴
2
コードの修正
answer
CHANGED
@@ -7,9 +7,9 @@
|
|
7
7
|
|
8
8
|
public function after($response)
|
9
9
|
{
|
10
|
-
$
|
10
|
+
$json = (string)$response;
|
11
|
-
$
|
11
|
+
$array = json_decode($json, true);
|
12
|
-
$res = ")]}'," . json_encode($
|
12
|
+
$res = ")]}'," . json_encode($array[1]);
|
13
13
|
return \Response::forge($res);
|
14
14
|
}
|
15
15
|
```
|
1
不要データを除去
answer
CHANGED
@@ -7,11 +7,13 @@
|
|
7
7
|
|
8
8
|
public function after($response)
|
9
9
|
{
|
10
|
+
$json_string = (string)$response;
|
11
|
+
$json = json_decode($json_string, true);
|
10
|
-
$res = ")]}'," . (
|
12
|
+
$res = ")]}'," . json_encode($json[1]);
|
11
|
-
return Response::forge($res);
|
13
|
+
return \Response::forge($res);
|
12
14
|
}
|
13
15
|
```
|
14
16
|
responseメソッドを通してフォーマットされたオブジェクトを一旦文字列化して、
|
15
17
|
再度Responseオブジェクトに詰めて返すで出来ました。
|
16
|
-
Controller_Restのafterを無視してい
|
18
|
+
Controller_Restのafterを無視していますが、JSON Vulnerability Protectionを
|
17
|
-
|
19
|
+
確認するため一時的になら問題ないかと。
|