diff --git a/composer.json b/composer.json index e90476a..35336e1 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ { "name": "Brian Matovu", "email": "mtvbrianking@gmail.com", - "homepage": "https://bmatovu.com", + "homepage": "http://bmatovu.com", "role": "Developer" } ], diff --git a/src/Http/Middleware/RequireXml.php b/src/Http/Middleware/RequireXml.php index 8e7d262..91c0326 100644 --- a/src/Http/Middleware/RequireXml.php +++ b/src/Http/Middleware/RequireXml.php @@ -10,6 +10,8 @@ class RequireXml /** * Handle an incoming request. * + * @link https://stackoverflow.com/a/11973933/2732184 + * * @param \Illuminate\Http\Request $request * @param \Closure $next * @param string|null $guard @@ -17,8 +19,8 @@ class RequireXml */ public function handle($request, Closure $next, $guard = null) { - if ($request->header('Accept') != 'text/xml') { - return response()->xml(['error' => 'Only accepting text/xml'], 406); + if ($request->getContentType() != 'xml') { + return response()->xml(['error' => 'Only accepting xml content'], 415); } return $next($request);