-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from skuvault-integrations/GUARD-2824-Magento-…
…API-Relative-Path GUARD-2824 Magento API Relative Path
- Loading branch information
Showing
64 changed files
with
816 additions
and
1,490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ src/packages/ | |
src/.vs | ||
[Rr]elease*/ | ||
_ReSharper*/ | ||
.idea/ | ||
_dotCover*/ | ||
_dotMemory*/ | ||
_dotTrace*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Net; | ||
|
||
namespace MagentoAccess | ||
{ | ||
/// <summary> | ||
/// Contains extensions provided methods for definitions of specific types of errors | ||
/// </summary> | ||
internal static class ExceptionExtensions | ||
{ | ||
/// <summary> | ||
/// Checks whether an exception is a Magento redirect-specific exception. | ||
/// </summary> | ||
/// <param name="exception"></param> | ||
/// <returns></returns> | ||
public static bool IsMagentoPermanentRedirectException( this Exception exception ) | ||
{ | ||
return exception is PermanentRedirectException || exception?.InnerException is PermanentRedirectException; | ||
} | ||
|
||
/// <summary> | ||
/// Checks whether an exception is a http 308 redirect-specific exception. | ||
/// </summary> | ||
/// <param name="exception"></param> | ||
/// <returns></returns> | ||
public static bool IsHttp308PermanentRedirectException( this Exception exception ) | ||
{ | ||
return exception?.InnerException is WebException | ||
&& ( int )( ( HttpWebResponse )( ( WebException )exception.InnerException ).Response ).StatusCode == 308; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.