Skip to content

Fix fatal error when the SERVER_PROTOCOL header is missing #495

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

Merged
merged 1 commit into from
May 5, 2021

Conversation

ste93cry
Copy link
Contributor

@ste93cry ste93cry commented May 4, 2021

As per title, fixes #494. It should not happen since the SERVER_PROTOCOL header must be present according to RFC 3875 (GCI spec), but in cases when it's mistakenly missing better be safe than sorry

@ste93cry ste93cry added this to the 4.1 milestone May 4, 2021
@ste93cry ste93cry requested a review from Jean85 May 4, 2021 19:35
@ste93cry ste93cry force-pushed the fix-crash-on-missing-server-protocol-header branch from 0deb6e5 to 35ac9a2 Compare May 4, 2021 19:38
@ste93cry ste93cry force-pushed the fix-crash-on-missing-server-protocol-header branch from 35ac9a2 to 16f1d5c Compare May 4, 2021 19:44
@ste93cry ste93cry merged commit c016dc2 into master May 5, 2021
@ste93cry ste93cry deleted the fix-crash-on-missing-server-protocol-header branch May 5, 2021 07:44
derrabus added a commit to symfony/symfony that referenced this pull request May 5, 2021
…null (Jean85)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Request::getProtocolVersion may return null

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

This is just a minor PHPDoc fix, but we stumbled on it in getsentry/sentry-symfony#495, and static analysis complains about our fix.

Basically, `SERVER_PROTOCOL` may not be set, even if it shouldn't be missing according to [RFC 3875 (GCI spec)](https://tools.ietf.org/html/rfc3875#section-4.1.16). In our case, the user reported the issue because the request was issued interally by a pod health check inside Kubernetes.

Commits
-------

99aadb3 getProtocolVersion may return null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when using php-fpm fcgi api without HTTP server
2 participants