Skip to content

Commit 366455f

Browse files
authored
Merge pull request #54 from contentstack/stage-to-dev
Stage to dev
2 parents 5c60cbb + aebaa0e commit 366455f

File tree

9 files changed

+22
-17
lines changed

9 files changed

+22
-17
lines changed

.github/workflows/nuget-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Push generated package to GitHub registry
2323
run: |
2424
cd out
25-
dotnet nuget push "contentstack.management.csharp.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols true --source https://api.nuget.org/v3/index.json
25+
dotnet nuget push "contentstack.management.csharp.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols --source https://api.nuget.org/v3/index.json
2626
2727
publish-git:
2828
runs-on: windows-latest
@@ -42,4 +42,4 @@ jobs:
4242
- name: Push generated package to GitHub registry
4343
run: |
4444
cd out
45-
dotnet nuget push "contentstack.management.csharp.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols true --source https://api.nuget.org/v3/index.json
45+
dotnet nuget push "contentstack.management.csharp.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols --source https://api.nuget.org/v3/index.json

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# Changelog
22

3-
## [v0.1.9](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.9)
3+
## [v0.1.10](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.10)
44
- Feat
55
- Add support for apiVersion in bulk publish unpublish methods
66

7+
## [v0.1.9](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.9)
8+
- Fix
9+
- Media header now added only to Assets API methods and removed from all others for both Sync and Async calls.
10+
11+
712
## [v0.1.8](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.8)
813
- Fix
914
- Strong named assemblies

Contentstack.Management.Core.Unit.Tests/Mokes/MockHttpHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public override Task<T> InvokeAsync<T>(IExecutionContext executionContext, bool
1414
return base.InvokeAsync<T>(executionContext, addAcceptMediaHeader);
1515
}
1616

17-
public override void InvokeSync(IExecutionContext executionContext, string apiVersion = null)
17+
public override void InvokeSync(IExecutionContext executionContext, bool addAcceptMediaHeader = false, string apiVersion = null)
1818
{
19-
base.InvokeSync(executionContext);
19+
base.InvokeSync(executionContext, addAcceptMediaHeader, apiVersion);
2020
}
2121
}
2222

@@ -43,7 +43,7 @@ public async Task<T> InvokeAsync<T>(IExecutionContext executionContext, bool add
4343
return await Task.FromResult<T>((T)executionContext.ResponseContext.httpResponse);
4444
}
4545

46-
public void InvokeSync(IExecutionContext executionContext, string apiVersion = null)
46+
public void InvokeSync(IExecutionContext executionContext, bool addAcceptMediaHeader = false, string apiVersion = null)
4747
{
4848
executionContext.ResponseContext.httpResponse = _response;
4949
if (executionContext.RequestContext.service != null)

Contentstack.Management.Core/ContentstackClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ protected void BuildPipeline()
179179
}, LogManager);
180180
}
181181

182-
internal ContentstackResponse InvokeSync<TRequest>(TRequest request, string apiVersion = null) where TRequest : IContentstackService
182+
internal ContentstackResponse InvokeSync<TRequest>(TRequest request, bool addAcceptMediaHeader = false, string apiVersion = null) where TRequest : IContentstackService
183183
{
184184
ThrowIfDisposed();
185185

@@ -191,7 +191,7 @@ internal ContentstackResponse InvokeSync<TRequest>(TRequest request, string apiV
191191
},
192192
new ResponseContext());
193193

194-
return (ContentstackResponse)ContentstackPipeline.InvokeSync(context, apiVersion).httpResponse;
194+
return (ContentstackResponse)ContentstackPipeline.InvokeSync(context, addAcceptMediaHeader, apiVersion).httpResponse;
195195
}
196196

197197
internal Task<TResponse> InvokeAsync<TRequest, TResponse>(TRequest request, bool addAcceptMediaHeader = false, string apiVersion = null)

Contentstack.Management.Core/Runtime/Pipeline/ContentstackRuntimePipeline.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public System.Threading.Tasks.Task<T> InvokeAsync<T>(IExecutionContext execution
9090
return _handler.InvokeAsync<T>(executionContext, addAcceptMediaHeader, apiVersion);
9191
}
9292

93-
public IResponseContext InvokeSync(IExecutionContext executionContext, string apiVersion = null)
93+
public IResponseContext InvokeSync(IExecutionContext executionContext, bool addAcceptMediaHeader = false, string apiVersion = null)
9494
{
9595
ThrowIfDisposed();
9696

97-
_handler.InvokeSync(executionContext, apiVersion);
97+
_handler.InvokeSync(executionContext, addAcceptMediaHeader, apiVersion);
9898
return executionContext.ResponseContext;
9999
}
100100

Contentstack.Management.Core/Runtime/Pipeline/HttpHandler/HttpHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ public async System.Threading.Tasks.Task<T> InvokeAsync<T>(IExecutionContext exe
5757
}
5858
}
5959

60-
public void InvokeSync(IExecutionContext executionContext, string apiVersion = null)
60+
public void InvokeSync(IExecutionContext executionContext, bool addAcceptMediaHeader = false, string apiVersion = null)
6161
{
6262
IHttpRequest httpRequest = null;
6363
try
6464
{
6565
var requestContext = executionContext.RequestContext;
6666

67-
httpRequest = requestContext.service.CreateHttpRequest(_httpClient, requestContext.config, apiVersion: apiVersion);
67+
httpRequest = requestContext.service.CreateHttpRequest(_httpClient, requestContext.config, addAcceptMediaHeader, apiVersion: apiVersion);
6868

6969
if (requestContext.service.HasRequestBody() && requestContext.service.Content != null)
7070
{

Contentstack.Management.Core/Runtime/Pipeline/IPipelineHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public interface IPipelineHandler
2525
/// </summary>
2626
/// <param name="executionContext"></param>
2727

28-
void InvokeSync(IExecutionContext executionContext, string apiVersion = null);
28+
void InvokeSync(IExecutionContext executionContext, bool addAcceptMediaHeader = false, string apiVersion = null);
2929

3030
/// <summary>
3131
///

Contentstack.Management.Core/Runtime/Pipeline/PipelineHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public virtual Task<T> InvokeAsync<T>(IExecutionContext executionContext, bool a
2020
throw new InvalidOperationException("Cannot invoke InnerHandler. InnerHandler is not set.");
2121
}
2222

23-
public virtual void InvokeSync(IExecutionContext executionContext, string apiVersion = null)
23+
public virtual void InvokeSync(IExecutionContext executionContext, bool addAcceptMediaHeader = false, string apiVersion = null)
2424
{
2525
if (this.InnerHandler != null)
2626
{
27-
InnerHandler.InvokeSync(executionContext, apiVersion);
27+
InnerHandler.InvokeSync(executionContext, addAcceptMediaHeader, apiVersion);
2828
return;
2929
}
3030
throw new InvalidOperationException("Cannot invoke InnerHandler. InnerHandler is not set.");

Contentstack.Management.Core/Runtime/Pipeline/RetryHandler/RetryHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ public override async Task<T> InvokeAsync<T>(IExecutionContext executionContext,
4646
throw new ContentstackException("No response was return nor exception was thrown");
4747
}
4848

49-
public override void InvokeSync(IExecutionContext executionContext, string apiVersion = null)
49+
public override void InvokeSync(IExecutionContext executionContext, bool addAcceptMediaHeader = false, string apiVersion = null)
5050
{
5151
var requestContext = executionContext.RequestContext;
5252
bool shouldRetry = false;
5353
do
5454
{
5555
try
5656
{
57-
base.InvokeSync(executionContext, apiVersion);
57+
base.InvokeSync(executionContext, addAcceptMediaHeader, apiVersion);
5858
return;
5959
}
6060
catch (Exception exception)

0 commit comments

Comments
 (0)