- Issue created by @longwave
- Merge request !7798Only set User-Agent for requests to the correct host. → (Open) created by longwave
- Status changed to Needs review
9 months ago 1:46pm 27 April 2024 - 🇬🇧United Kingdom longwave UK
Actually, we can solve both problems here: explicitly throw an exception if we make a request to another host, and then we will never send the Drupal User-Agent to any other host anyway.
- 🇫🇷France andypost
Sounds like known bug 🐛 Tests should not do requests to updates.drupal.org Needs work
- 🇬🇧United Kingdom longwave UK
I imagine this is going to break contrib or custom tests that explicitly want to talk to third party services (remote search servers for example).
- 🇬🇧United Kingdom catch
This is flushing out a lot of http requests in core tests too. I'm not sure we can commit it even once those are fixed for the reasons given in #7, maybe we can add some kind of flag to enable the behaviour or not?
- 🇬🇧United Kingdom longwave UK
OEmbedTestTrait has what might be a better method:
/** * Configures the HTTP client to always use the fixtures directory. * * All requests are carried out relative to the URL of the fixtures directory. * For example, after calling this method, a request for foobar.html will * actually request http://test-site/path/to/fixtures/foobar.html. */ protected function lockHttpClientToFixtures() { $this->writeSettings([ 'settings' => [ 'http_client_config' => [ 'base_uri' => (object) [ 'value' => $this->getFixturesUrl() . '/', 'required' => TRUE, ], ], ], ]);
- Status changed to Needs work
9 months ago 3:14pm 29 April 2024 - 🇬🇧United Kingdom longwave UK
This is acting differently on local vs GitLab CI and I have no idea why.
- 🇮🇹Italy mondrake 🇮🇹
Removing PHPUnit 10 tag, it's no longer strictly related to the PHPUnit upgrade.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
If we block requests to anything other than the site under test we're going to break contrib and custom tests big time.
- 🇬🇧United Kingdom catch
I think it would fine if we only blocked it for core tests, but it would be good to 100% enforce it in core because it is easy to do this without realising - as we've found out.
- First commit to issue fork.