opened
JunkMyFunk
username_0
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.
createAnalytics method in factory throws InvalidArgumentException when no user-agent set
issue
created
foaly-nr1
username_1
Thanks @username_0. Are you happy to open a pull request?
comment
closed
foaly-nr1
username_1
issue