ProcessWireUpgrade icon indicating copy to clipboard operation
ProcessWireUpgrade copied to clipboard

Set PHP's user_agent if empty

Open BitPoet opened this issue 9 years ago • 3 comments

Set PHP's user_agent to a non-empty value if not set, as github api requests with an empty/missing user-agent header are rejected with status 403 (forbidden). This should fix issue #11.

BitPoet avatar Jan 24 '16 15:01 BitPoet

@BitPoet Hi! Do you think this is still needed? That is, if a GitHub request with an empty/missing user-agent header is rejected? How do I check this? I never got any errors or warnings using this module.

matjazpotocnik avatar May 09 '21 06:05 matjazpotocnik

I'm not sure how to check this, as the error has always shown up inconsistently, but it probably should still be dealt with. The GitHub API docs specifically require a value in the User-Agent header.

BitPoet avatar May 11 '21 07:05 BitPoet

@BitPoet @matjazpotocnik This module uses WireHttp so the user-agent header should always be present. WireHttp supplies a default one if any outbound http request fails to specify one. Though it looks like this module uses its name (ProcessWireUpgrade) as the user-agent header.

ryancramerdesign avatar May 11 '21 14:05 ryancramerdesign