Skip to content

Conversation

@dmilov
Copy link
Contributor

@dmilov dmilov commented Aug 12, 2021

Signed-off-by: Dimitar Milov dmilov@vmware.com

Description

Fixes issue #42. When Content-Type prefix other than application/cloudevents is used the event is considered to be binary mode. For the binary mode of HTTP there are headers that are required by the protocol. There was no handling of required headers which leads to the wrong behavior described in issue #42 .

Added handling of required fields for binary content mode.

Closes: #(issue-number)

Type of change

Please mark options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. If applicable, please also list any relevant
details for your test configuration.

  • Added unit tests test to cover required CE fields are specified in the HTTP headers
PS C:\git-repos\github\sdk-powershell> .\build.ps1                                                                  

[11:08:59 AM] INFO: Publish CloudEvents.Sdk Module to 'C:\git-repos\github\sdk-powershell\CloudEvents.Sdk'
[11:09:00 AM] INFO: Run unit tests

Starting discovery in 9 files.
Discovery finished in 304ms.
[+] C:\git-repos\github\sdk-powershell\test\unit\ConvertFrom-HttpMessage.Tests.ps1 979ms (374ms|450ms)
[+] C:\git-repos\github\sdk-powershell\test\unit\ConvertTo-HttpMessage.Tests.ps1 331ms (120ms|180ms)
[+] C:\git-repos\github\sdk-powershell\test\unit\New-CloudEvent.Tests.ps1 169ms (27ms|134ms)
[+] C:\git-repos\github\sdk-powershell\test\unit\Read-CloudEventData.Tests.ps1 166ms (17ms|126ms)
[+] C:\git-repos\github\sdk-powershell\test\unit\Read-CloudEventJsonData.Tests.ps1 180ms (41ms|125ms)
[+] C:\git-repos\github\sdk-powershell\test\unit\Read-CloudEventXmlData.Tests.ps1 198ms (61ms|118ms)
[+] C:\git-repos\github\sdk-powershell\test\unit\Set-CloudEventData.Tests.ps1 230ms (52ms|167ms)
[+] C:\git-repos\github\sdk-powershell\test\unit\Set-CloudEventJsonData.Tests.ps1 169ms (26ms|131ms)
[+] C:\git-repos\github\sdk-powershell\test\unit\Set-CloudEventXmlData.Tests.ps1 167ms (39ms|119ms)
Tests completed in 2.62s
Tests Passed: 32, Failed: 0, Skipped: 0 NotRun: 0

Test Configuration:

  • Toolchain:
  • SDK:
  • (add more if needed)

Checklist:

  • My code follows the contribution
    guidelines
    of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@lamw lamw requested a review from embano1 August 25, 2021 15:21
Copy link
Member

@embano1 embano1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for this Dimitar, changes to logic and tests LGTM. Just one question how we want to handle ModuleVersion bumps in the future.

Signed-off-by: Dimitar Milov <dmilov@vmware.com>
@dmilov dmilov force-pushed the topic/no-content-type branch from 2da831b to 7eb0f9b Compare August 30, 2021 07:46
Copy link
Member

@embano1 embano1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dmilov dmilov merged commit c715c5c into cloudevents:main Aug 30, 2021
@dmilov dmilov deleted the topic/no-content-type branch August 30, 2021 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants