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

Content-Length header has wrong value #41

Open
dskloet opened this issue Aug 5, 2021 · 0 comments
Open

Content-Length header has wrong value #41

dskloet opened this issue Aug 5, 2021 · 0 comments

Comments

@dskloet
Copy link

dskloet commented Aug 5, 2021

At https://github.com/SherClockHolmes/webpush-go/blob/master/webpush.go#L186
the Content-Length header is set to len(ciphertext).
This is the wrong value but it doesn't matter because somehow the net/http library sets the value to the actual length of the actual content.
I discovered this because I had the same mistake and couldn't get my code to work after porting it to PHP, until I set the Content-Length to recordSize.
When I sent my request to my own server instead of to the notification endpoint, I discovered that the actual value of the Content-Length header is different in Go vs. PHP.

Richtermeister pushed a commit to Richtermeister/webpush-go that referenced this issue Jun 9, 2022
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