You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code below, the path of the URL is processed with rtrim and ltrim.
This process trims the "?" at the end, but it cannot be processed when parameters are included, such as /_bulk?timeout=60s.
src/Network/Request.php
protected function parseOrFail(array $payload): static {
static::validateInputFields($payload, static::PAYLOAD_FIELDS);
// Checking if request format and endpoint are supported
$this->path = rtrim(ltrim($payload['message']['path_query'], '/'), '?'); # here!
I understand that it currently evaluates endpoints containing parameters such as "sql?mode=raw".
I don't think this implementation is clean.
In the first place, PHP has a parse_url() function, so it may be easier to implement using that function.
And I think it's better to evaluate paths and parameters separately. Also in the future.
In the code below, the path of the URL is processed with rtrim and ltrim.
This process trims the "?" at the end, but it cannot be processed when parameters are included, such as /_bulk?timeout=60s.
I understand that it currently evaluates endpoints containing parameters such as "sql?mode=raw".
I don't think this implementation is clean.
In the first place, PHP has a parse_url() function, so it may be easier to implement using that function.
And I think it's better to evaluate paths and parameters separately. Also in the future.
The text was updated successfully, but these errors were encountered: