Skip to content

from_http doesn't accept capitalized required arguments nor None data #105

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

Closed
cumason123 opened this issue Aug 16, 2020 · 0 comments
Closed

Comments

@cumason123
Copy link
Contributor

Expected Behavior

from cloudevents.http import from_http
headers = {
    "Ce-Source": "<my-source>",
    "Ce-Specversion": "1.0",
    "Ce-Type": "my-type",
    "Ce-Id": str(uuid4())
}
from_http("", headers)

should pass despite upper-cased attributes names.

from cloudevents.http import from_http
headers = {
    "ce-source": "<my-source>",
    "ce-specversion": "1.0",
    "ce-type": "my-type",
    "ce-id": str(uuid4())
}
from_http(None, headers)

likewise, this should return an event with data set to none.

Actual Behavior

None data causes _json_or_string to fail, Recommend addding a None if statement in that function.

Capitalized ce-specversion isn't read by from_http. Instead, from_http should make all keys lower case before passing it into future functionality.

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

No branches or pull requests

1 participant