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

Adding allow header makes validation fail #80

Closed
sandromastronardi opened this issue Dec 11, 2020 · 9 comments · Fixed by #145
Closed

Adding allow header makes validation fail #80

sandromastronardi opened this issue Dec 11, 2020 · 9 comments · Fixed by #145
Assignees
Milestone

Comments

@sandromastronardi
Copy link

sandromastronardi commented Dec 11, 2020

response.Headers.Add("Allow", "POST");

When this code is adding the Allow header I get this response:
Misused header name. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects.

It appears that you must add it to .Content.Headers.Add("Allow", "POST");
source: https://stackoverflow.com/questions/14286436/why-i-cannot-set-allow-in-http-response-header

Without this, I can't use this in an azure function in .net core 3.1
not sure if this is a bug in other versions, I assume it behaves this way in all .NET versions?

@jskeet jskeet added this to the 2.0.0-beta.2 milestone Jan 13, 2021
@JoshLove-msft JoshLove-msft self-assigned this Jan 15, 2021
jskeet added a commit to jskeet/sdk-csharp that referenced this issue May 21, 2021
jskeet added a commit that referenced this issue May 21, 2021
@sandromastronardi
Copy link
Author

Great, thanks for the fix.

@sandromastronardi
Copy link
Author

I seem to be unable to find how to do validation in the newest versions... I see this code in the 1.x versions, but not after... how do I validate?

@jskeet
Copy link
Contributor

jskeet commented Oct 18, 2022

@sandromastronardi: Please could you file a new issue, with details of what kind of validation you want to do where? (It's not directly related to this bug.)

@sandromastronardi
Copy link
Author

Hi @jskeet,

Thanks for the quick response, but how is it not related? As i cannot find the code you changed in the releases, has the code ever been released?

@jskeet
Copy link
Contributor

jskeet commented Oct 18, 2022

Thanks for the quick response, but how is it not related?

Because one is "this code should work and doesn't" (which was fixed by #145), the other is a question of "what code should I write to validate a CloudEvent?".

As i cannot find the code you changed in the releases, has the code ever been released?

Yes, there have been multiple releases of the various CloudNative.CloudEvents packages since this issue was closed. (This change would have been in CloudNative.CloudEvents.) The commit history shows all the changes, including releases.

I feel I may be missing what you're asking though...

@sandromastronardi
Copy link
Author

Hi @jskeet ,

I did see the fix commit, but in 1.3 it was not fixed yet, and in 2.0 releases its not at all there... so I have the feeling your fix has never made it to a release?
But I'll make a new issue then, as i'm probably wrong in assuming the new version would validate an endpoint in the same way...

@sandromastronardi
Copy link
Author

New issue: #243

@jskeet
Copy link
Contributor

jskeet commented Oct 18, 2022

I think I was confused by you not being specific about what you mean by "how to do validation". Are you specifically interested in webhook validation, not CloudEvent validation? That information would have been really helpful. Now I have a bit more context, I'll do some digging. (As I say though,. you can see all the changes in the code - everything is released via GitHub actions, so if we've removed webhook validation, that'll be in the history.)

@sandromastronardi
Copy link
Author

Ah, sorry about that, as the ticket was about the webhook validation I assumed it was clear, my bad. I didn't know about any other validation.
I have been trying to look for it have not found yet where it was removed.

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 a pull request may close this issue.

3 participants