aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common')
-rw-r--r--MediaBrowser.Common/Extensions/BaseExtensions.cs10
-rw-r--r--MediaBrowser.Common/Extensions/ResourceNotFoundException.cs24
-rw-r--r--MediaBrowser.Common/IApplicationHost.cs5
-rw-r--r--MediaBrowser.Common/Net/CustomHeaderNames.cs11
4 files changed, 41 insertions, 9 deletions
diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs
index db0514bb1..40c16b957 100644
--- a/MediaBrowser.Common/Extensions/BaseExtensions.cs
+++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs
@@ -1,6 +1,7 @@
using System;
+using System.Text;
using System.Text.RegularExpressions;
-using MediaBrowser.Model.Cryptography;
+using System.Security.Cryptography;
namespace MediaBrowser.Common.Extensions
{
@@ -9,8 +10,6 @@ namespace MediaBrowser.Common.Extensions
/// </summary>
public static class BaseExtensions
{
- public static ICryptoProvider CryptographyProvider { get; set; }
-
/// <summary>
/// Strips the HTML.
/// </summary>
@@ -31,7 +30,10 @@ namespace MediaBrowser.Common.Extensions
/// <returns>Guid.</returns>
public static Guid GetMD5(this string str)
{
- return CryptographyProvider.GetMD5(str);
+ using (var provider = MD5.Create())
+ {
+ return new Guid(provider.ComputeHash(Encoding.Unicode.GetBytes(str)));
+ }
}
}
}
diff --git a/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs b/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs
index f62c65fd7..9f70ae7d8 100644
--- a/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs
+++ b/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs
@@ -26,6 +26,30 @@ namespace MediaBrowser.Common.Extensions
}
}
+ /// <summary>
+ /// Class MethodNotAllowedException
+ /// </summary>
+ public class MethodNotAllowedException : Exception
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MethodNotAllowedException" /> class.
+ /// </summary>
+ public MethodNotAllowedException()
+ {
+
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MethodNotAllowedException" /> class.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ public MethodNotAllowedException(string message)
+ : base(message)
+ {
+
+ }
+ }
+
public class RemoteServiceUnavailableException : Exception
{
public RemoteServiceUnavailableException()
diff --git a/MediaBrowser.Common/IApplicationHost.cs b/MediaBrowser.Common/IApplicationHost.cs
index 2925a3efd..cb7343440 100644
--- a/MediaBrowser.Common/IApplicationHost.cs
+++ b/MediaBrowser.Common/IApplicationHost.cs
@@ -26,11 +26,6 @@ namespace MediaBrowser.Common
string SystemId { get; }
/// <summary>
- /// Occurs when [application updated].
- /// </summary>
- event EventHandler<GenericEventArgs<PackageVersionInfo>> ApplicationUpdated;
-
- /// <summary>
/// Gets or sets a value indicating whether this instance has pending kernel reload.
/// </summary>
/// <value><c>true</c> if this instance has pending kernel reload; otherwise, <c>false</c>.</value>
diff --git a/MediaBrowser.Common/Net/CustomHeaderNames.cs b/MediaBrowser.Common/Net/CustomHeaderNames.cs
new file mode 100644
index 000000000..ff148dc80
--- /dev/null
+++ b/MediaBrowser.Common/Net/CustomHeaderNames.cs
@@ -0,0 +1,11 @@
+namespace MediaBrowser.Common.Net
+{
+ public static class CustomHeaderNames
+ {
+ // Other Headers
+ public const string XForwardedFor = "X-Forwarded-For";
+ public const string XForwardedPort = "X-Forwarded-Port";
+ public const string XForwardedProto = "X-Forwarded-Proto";
+ public const string XRealIP = "X-Real-IP";
+ }
+} \ No newline at end of file