Skip to content

Commit

Permalink
Merge branch 'release/2.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed Apr 17, 2020
2 parents 7f70b86 + fa771e5 commit d6b61e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.4.0

* Skip requests with header "X-Requested-With: XMLHttpRequest"

# 2.3.2

* Improve error handling in plugin migration process
Expand Down
3 changes: 2 additions & 1 deletion classes/RedirectMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public function __construct(
public function handle(Request $request, Closure $next)
{
// Only handle specific request methods.
if (!in_array($request->method(), self::$supportedMethods, true)
if ($request->isXmlHttpRequest()
|| !in_array($request->method(), self::$supportedMethods, true)
|| Str::startsWith($request->getRequestUri(), '/vdlp/redirect/sparkline/')
) {
return $next($request);
Expand Down
2 changes: 2 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@
- "Fix SQLSTATE[42S22] error when installing plugin -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.3.1"
2.3.2:
- "Improve error handling in plugin migration process -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.3.2"
2.4.0:
- "Skip requests with header 'X-Requested-With: XMLHttpRequest' -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.4.0"

0 comments on commit d6b61e3

Please sign in to comment.