api/stream: add Estimated-Content-Length header to tunnels
present where Content-Length cannot be accurately calculated, pure proxy streams do not have this header and instead have the accurate Content-Length one.
This commit is contained in:
@@ -72,6 +72,16 @@ export function getInternalTunnel(id) {
|
||||
return internalStreamCache.get(id);
|
||||
}
|
||||
|
||||
export function getInternalTunnelFromURL(url) {
|
||||
url = new URL(url);
|
||||
if (url.hostname !== '127.0.0.1') {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = url.searchParams.get('id');
|
||||
return getInternalTunnel(id);
|
||||
}
|
||||
|
||||
export function createInternalStream(url, obj = {}) {
|
||||
assert(typeof url === 'string');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user