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

Rename parseFieldValueComponents to parseMultipleHeaderFields #46

Closed
wants to merge 5 commits into from

Conversation

rekryt
Copy link

@rekryt rekryt commented Apr 10, 2023

compatibility to http v2.0.0

@rekryt
Copy link
Author

rekryt commented Apr 15, 2023

Tests fixed

@@ -111,7 +111,7 @@ private function generateRequest(WebsocketHandshake $handshake, string $key): Re
$request->setTlsHandshakeTimeout($handshake->getTlsHandshakeTimeout());
$request->setHeaderSizeLimit($handshake->getHeaderSizeLimit());

$extensions = \array_column(Http\parseFieldValueComponents($request, 'sec-websocket-extensions') ?? [], 0, 0);
$extensions = \array_column(Http\parseMultipleHeaderFields($request, 'sec-websocket-extensions') ?? [], 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use parseHeaderTokens here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, updated

@rekryt
Copy link
Author

rekryt commented Apr 15, 2023

Need tag of amphp/http-server
v3.0.0-beta.7 (^3) is less relevant than 3.x-dev

self::DEFAULT_CONNECTIONS_PER_IP_LIMIT
);

$httpServer = new SocketHttpServer($logger, $serverSocketFactory, $clientFactory);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use SocketHttpServer::createForDirectAccess() instead.

@@ -71,7 +71,7 @@ public function connect(WebsocketHandshake $handshake, ?Cancellation $cancellati
return;
}

$extensions = \array_column(Http\parseMultipleHeaderFields($response, 'sec-websocket-extensions') ?? [], 0, 0);
$extensions = \array_column(Http\parseHeaderTokens($response, 'sec-websocket-extensions') ?? [], 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array_column can and should be dropped then, no?

@bennnjamin
Copy link

I need to get this merged so that I can update all http-* packages in my project to the latest version. Currently, this pull request is blocking any further updates to the http-* packages since this package also relies on http v2. What can I do to help move this along? Happy to open another PR if needed.

@trowski
Copy link
Member

trowski commented Apr 26, 2023

Resolved by 24daf3c and tagged in 2.0.0 Beta 3.

@trowski trowski closed this Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants