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

createAnalytics method in factory throws InvalidArgumentException when no user-agent set #9

Closed
JunkMyFunk opened this issue Nov 24, 2016 · 1 comment

Comments

@JunkMyFunk
Copy link

Injecting this service into another service causes the createAnalytics() method to be called, which accesses the request stack to get the User-Agent header. In the case this is not set (which often happens with requests from bots or 3rd party API callbacks) an exception is thrown. Since this happens when the services are instantiated, it's hard to handle gracefully.

Passing an empty string to the setUserAgentOverride() method does not throw an exception, only a null value does. Since the user-agent isn't required by the GAMP API anyway, it seems this method should not be called in the constructor or gracefully handle a null value.

@foaly-nr1
Copy link
Contributor

Thanks @JunkMyFunk. Are you happy to open a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants