Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Emit correct x-protobuf in metadata instructions

  • Loading branch information...
commit 72b638b0749c86cef5bee940c659712cf77e25af 1 parent 4c87338
@mythz mythz authored
View
5 src/ServiceStack.Common/Web/ContentType.cs
@@ -181,7 +181,10 @@ public static Feature ToFeature(this string contentType)
public static string GetContentFormat(Format format)
{
- return format.ToString().ToLower();
+ var formatStr = format.ToString().ToLower();
+ return format == Format.MsgPack || format == Format.ProtoBuf
+ ? "x-" + formatStr
+ : formatStr;
}
public static string GetContentFormat(string contentType)
View
12 src/ServiceStack.Plugins.ProtoBuf/AppStart.cs
@@ -1,12 +0,0 @@
-using ServiceStack.WebHost.Endpoints;
-
-namespace ServiceStack.Plugins.ProtoBuf
-{
- public class AppStart
- {
- public static void Start()
- {
- EndpointHost.AddPlugin(new ProtoBufFormat());
- }
- }
-}
View
1  src/ServiceStack.Plugins.ProtoBuf/ServiceStack.Plugins.ProtoBuf.csproj
@@ -38,7 +38,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="AppStart.cs" />
<Compile Include="ProtoBufFormat.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProtoBufServiceClient.cs" />
View
15 tests/ServiceStack.WebHost.IntegrationTests/Services/CachedProtoBufEmailService.cs
@@ -38,18 +38,13 @@ protected override object Run(UncachedProtoBufEmail request)
}
}
- class CachedProtoBufEmailService : ServiceBase<CachedProtoBufEmail>
+ class CachedProtoBufEmailService : ServiceInterface.Service
{
- public IDbConnectionFactory DbFactory { get; set; }
-
- public ICacheClient CacheClient { get; set; }
-
- protected override object Run(CachedProtoBufEmail request)
+ protected object Any(CachedProtoBufEmail request)
{
- return base.RequestContext.ToOptimizedResultUsingCache(
- this.CacheClient,
- UrnId.Create<ProtoBufEmail>(request.FromAddress ?? "none"),
- () => new ProtoBufEmail { FromAddress = request.FromAddress ?? "none" });
+ return base.RequestContext.ToOptimizedResultUsingCache(this.Cache,
+ UrnId.Create<ProtoBufEmail>(request.FromAddress ?? "none"),
+ () => new ProtoBufEmail { FromAddress = request.FromAddress ?? "none" });
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.