chore(deps): update dependency amphp/http-server to v3 #1417
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.1
->^3.0
Release Notes
amphp/http-server (amphp/http-server)
v3.3.0
: 3.3.0Compare Source
What's Changed
RequestBody
now implementsStringable
so the entire request body can be buffered by simply casting the object to a string (note the request body length limits still apply).ClientException
now extendsAmp\ByteStream\StreamException
to avoid violating theReadableStream
interface by throwing a non-StreamException
from a stream method.New Contributors
Full Changelog: amphp/http-server@v3.2.0...v3.3.0
v3.2.0
: 3.2.0Compare Source
league/uri@v7.1
andpsr/message@v2
HttpErrorException
constructorFull Changelog: amphp/http-server@v3.1.0...v3.2.0
v3.1.0
: 3.1.0Compare Source
What's Changed
HttpErrorException
by @kelunik in https://github.com/amphp/http-server/pull/352Full Changelog: amphp/http-server@v3.0.0...v3.1.0
v3.0.0
: 3.0.0Compare Source
Stable release compatible with AMPHP v3 and fibers! 🎉
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of
Promise<ResolutionType>
have been replaced withResolutionType
.The
RequestHandler
andMiddleware
interfaces along with theRequest
andResponse
objects are largely unchanged with the exception of replacingPromise
objects with the resolution type.RequestHandler::handleRequest()
andMiddleware::handleRequest()
has changed fromPromise<Response>
toResponse
.ReadableStream
or a string (note the interface name change inamphp/byte-stream
).null
will no longer be cast to an empty body.Creating an HTTP Server
Initializing a server has changed significantly.
The
Options
object has been removed, replaced by constructor parameters on various components. PHP 8.0's named parameters allows only defining the parameters you wish to override without the need to define those you do not wish to change.HttpServer
is now an interface.ServerObserver
has been removed and replaced withonStart()
andonStop()
methods on theHttpServer
interface.SocketHttpServer
is the provided default implementation ofHttpServer
. The methodsgetLogger()
,getRequestHandler()
, andgetErrorHandler()
are no longer part ofHttpServer
to avoid the interface being used as a service-locator.In addition to the constructor,
SocketHttpServer
provides two convenience static constructors for common use-cases.createForDirectAccess()
— Creates an instance appropriate for direct access by the publiccreateForBehindProxy()
— Creates an instance appropriate for use when behind a proxy service such as nginx'Listening interfaces are provided to
SocketHttpServer
using theexpose()
method. TheRequestHandler
andErrorHandler
instances are not provided to the constructor, instead being provided to theSocketHttpServer::start()
method. As these objects are provided after constructing theHttpServer
instance,RequestHandlers
may now require an instance ofHttpServer
in their constructors to attach start and stop handlers.SocketServer
instances are then created bySocketHttpServer
using an instance ofSocketServerFactory
passed to the constructor. This allows server bind contexts to be initialized based on the provided (or default)HttpDriverFactory
.Below is the "Hello, World!" example from examples/hello-world.php as an example of initializing a
SocketHttpServer
instance.New Middlewares
ConcurrencyLimitingMiddleware
to limit the number of requests which may be concurrently handled by the server.ForwardedMiddleware
and associatedForwarded
class andForwardedHeaderType
enum. This middleware parses eitherForwarded
orX-Forwarded-For
headers to determine the original client address when used behind a proxy supporting these headers.AllowedMethodsMiddleware
which limits the allowed HTTP verbs used by requests. This middleware is used automatically bySocketHttpServer
. The allowed methods can be specified through a constructor parameter, using null to disable the middleware.HTTP Drivers
Generally consumers of this library need not worry about these changes unless they implemented their own HTTP driver or interacted with the
Client
interface beyond grabbing client metadata.Client
is a significantly thinner interface, consisting of only metadata about the client connection.HttpDriver
instances now handle responding to requests instead of theClient
object.HttpDriver::setup()
has been replaced withHttpDriver::handleClient
. Rather than returning a Generator parser which is fed data read from the client, this method is instead expected to read/write data from the provided streams itself.HttpDriver::write()
has been removed, as writing to the client should be handled internally within the driver.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.