Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Profiler] Fix profiler nullable string type#36162

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:5.0frommRoca:fix_profile_set_ip_type
Apr 21, 2020
Merged

[Profiler] Fix profiler nullable string type#36162

fabpot merged 1 commit intosymfony:5.0frommRoca:fix_profile_set_ip_type
Apr 21, 2020

Conversation

@mRoca
Copy link
Contributor

@mRocamRoca commentedMar 21, 2020
edited
Loading

QA
Branch?5.0
Bug fix?yes
New feature?no
Deprecations?no
Ticketsn/a
LicenseMIT
Doc PR-

This PR fixes nullable string types in setter for the Profile class.

The detected issue comes fromthe Profiler class :

$profile->setIp($request->getClientIp());// string or null

The corresponding return types for the Profile getters are allready good:

/**     * Returns the IP.     *     * @return string|null The IP     */publicfunctiongetIp()    {return$this->ip;    }

@Kocal
Copy link
Member

Or maybe we can call->setIp() only when$request->getClientIp() is notnull?

@nicolas-grekasnicolas-grekas added this to the5.0 milestoneMar 23, 2020
@nicolas-grekas
Copy link
Member

Setting the IP or URL to null doesn't look useful from the pov of the API, does it? How did you spot this?

@mRoca
Copy link
ContributorAuthor

I've spotted it by calling the fpm agent withcgi-fcgi (for container cache warmup & docker healthcheck):

REDIRECT_STATUS=true SCRIPT_FILENAME=/srv/public/index.php HTTP_HOST=127.0.0.1 REQUEST_URI=/ REQUEST_METHOD=GET HTTP_USER_AGENT=probe cgi-fcgi -bind -connect 127.0.0.1:9001

This line command won't work because of this type bug, as$request->getClientIp() parses the$_SERVER['REMOTE_ADDR'] value. But if I add the corresponding headerREMOTE_ADDR=127.0.0.1 to the command, everything is fine.

@fabpot
Copy link
Member

Thank you@mRoca.

@fabpotfabpot merged commit22f1076 intosymfony:5.0Apr 21, 2020
@mRocamRoca deleted the fix_profile_set_ip_type branchApril 22, 2020 09:03
@fabpotfabpot mentioned this pull requestApr 28, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.0

Development

Successfully merging this pull request may close these issues.

5 participants

@mRoca@Kocal@nicolas-grekas@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp