Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX - 1213 - added early access header #51

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Version: 2.16.0
#### Date: Sep-3-2024

##### New Feature:
- Added Early Access Header Support

### Version: 2.15.0
#### Date: Jul-30-2024

Expand Down
7 changes: 6 additions & 1 deletion Contentstack.Core/Configuration/ContentstackOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ public ContentstackOptions()
{
Timeout = 30000; // Set default value
}
}

/// <summary>
/// TheEarlyAccessHeader used to set service which the user has early access to.
/// </summary>
public string[] EarlyAccessHeader { get; set; }
}

internal class ContentstackRegionConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Expand Down
4 changes: 4 additions & 0 deletions Contentstack.Core/ContentstackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public ContentstackClient(IOptions<ContentstackOptions> options)
{
this.SetHeader("access_token", _options.DeliveryToken);
}
if(_options.EarlyAccessHeader !=null)
{
this.SetHeader("x-header-ea", string.Join(",", _options.EarlyAccessHeader));
}
Config cnfig = new Config();
cnfig.Environment = _options.Environment;
if (_options.Host != null)
Expand Down
Loading