File tree Expand file tree Collapse file tree 1 file changed +15
-17
lines changed
src/Illuminate/Http/Concerns Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -41,23 +41,7 @@ public function isJson()
41
41
*/
42
42
public function expectsJson ()
43
43
{
44
- return ($ this ->ajax () && ! $ this ->pjax () && $ this ->wantsAnyContentType ()) || $ this ->wantsJson ();
45
- }
46
-
47
- /**
48
- * Determine if the current request is asking for any content type in return.
49
- *
50
- * @return bool
51
- */
52
- public function wantsAnyContentType ()
53
- {
54
- $ acceptable = $ this ->getAcceptableContentTypes ();
55
-
56
- if (count ($ acceptable ) === 0 ) {
57
- return true ;
58
- }
59
-
60
- return isset ($ acceptable [0 ]) && ($ acceptable [0 ] === '*/* ' || $ acceptable [0 ] === '* ' );
44
+ return ($ this ->ajax () && ! $ this ->pjax () && $ this ->acceptsAnyContentType ()) || $ this ->wantsJson ();
61
45
}
62
46
63
47
/**
@@ -134,6 +118,20 @@ public function prefers($contentTypes)
134
118
}
135
119
}
136
120
121
+ /**
122
+ * Determine if the current request accepts any content type in return.
123
+ *
124
+ * @return bool
125
+ */
126
+ public function acceptsAnyContentType ()
127
+ {
128
+ $ acceptable = $ this ->getAcceptableContentTypes ();
129
+
130
+ return count ($ acceptable ) === 0 || (
131
+ isset ($ acceptable [0 ]) && ($ acceptable [0 ] === '*/* ' || $ acceptable [0 ] === '* ' )
132
+ );
133
+ }
134
+
137
135
/**
138
136
* Determines whether a request accepts JSON.
139
137
*
You can’t perform that action at this time.
0 commit comments