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
Http: Refactor Server for clarity, compliance and consistency
- Rename:
- `getProxyTls()` -> `proxyHasTls()`
- `getProxyBasePath()` -> `getProxyPath()`
- `getBaseUri()` -> `getUri()` (and return `Uri`, not `string`)
- Remove superfluous `getScheme()`
- Add:
- `getLocalIpAddress()`
- `getLocalPort()` (useful when port is dynamically allocated)
- Allow `stop()` to be called when the server is not running
- In `listen()`:
- Replace `$callback` with `$listener`, which returns a
`ServerResponse` instead of receiving control variables by reference
- Keep listening for requests until a response has a return value
unless a non-negative `$limit` is given
- Add request target validity checks
- Respond to invalid requests with "400 Bad Request" and don't throw
the underlying exception by default
- Fix issue where large responses might not be written in full
- Throw `LogicException` when:
- `getProxy*()` is called on an instance with no proxy
- an assertion fails (instead of `HttpServerException`)
0 commit comments