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

Auditable trait. Failed resolveUserAgent when User-Agent is empty #372

Closed
dominikveils opened this issue Jan 19, 2018 · 3 comments
Closed
Assignees
Labels
bug Issue, error or unexpected behavior

Comments

@dominikveils
Copy link

dominikveils commented Jan 19, 2018

Q A
Bug? yes
New Feature? yes
Framework Laravel
Framework version 5.5
Package version v5.0.3
PHP version 7.x.y

Actual Behaviour

PHP7 type error (return value) is thrown when request missing User-Agent header.

Expected Behaviour

Expected to get empty User-Agent, not null or exception

Steps to Reproduce

Make http request without User-Agent header and save Auditable model.

Possible Solutions

Explicity typecast to (string) return value of resolveUserAgent and other functions in Auditable trait.

@quetzyg quetzyg self-assigned this Jan 21, 2018
@quetzyg quetzyg added the bug Issue, error or unexpected behavior label Jan 21, 2018
@quetzyg
Copy link
Contributor

quetzyg commented Jan 21, 2018

Thanks for reporting this @dominikveils, I'll fix it ASAP.

@quetzyg
Copy link
Contributor

quetzyg commented Jan 28, 2018

In version 6, the default User Agent resolver won't have this issue.

@quetzyg quetzyg closed this as completed Jan 28, 2018
@quetzyg
Copy link
Contributor

quetzyg commented Feb 6, 2018

While version 6 isn't released, I've tagged version 5.0.4, which addresses this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue, error or unexpected behavior
Projects
None yet
Development

No branches or pull requests

2 participants