MCPcopy Create free account
hub / github.com/angular/dev-infra / processHeader

Function processHeader

github-actions/browserstack/set-browserstack-env.js:2112–2185  ·  view source on GitHub ↗
(request, key, val)

Source from the content-addressed store, hash-verified

2110 __privateMethod(this, _publishUpgradeTrailers, publishUpgradeTrailers_fn).call(this);
2111 }
2112 /**
2113 * @param {Error} error
2114 */
2115 onUpgradeError(error) {
2116 assert(!this.aborted);
2117 assert(this.completed);
2118 if (channels.error.hasSubscribers) {
2119 channels.error.publish({ request: this, error });
2120 }
2121 }
2122 onComplete(trailers) {
2123 this.onFinally();
2124 assert(!this.aborted);
2125 this.completed = true;
2126 if (channels.trailers.hasSubscribers) {
2127 channels.trailers.publish({ request: this, trailers });
2128 }
2129 try {
2130 return this[kHandler].onComplete(trailers);
2131 } catch (err) {
2132 this.onError(err);
2133 }
2134 }
2135 onError(error) {
2136 this.onFinally();
2137 if (channels.error.hasSubscribers) {
2138 channels.error.publish({ request: this, error });
2139 }
2140 if (this.aborted) {
2141 return;
2142 }
2143 this.aborted = true;
2144 return this[kHandler].onError(error);
2145 }
2146 onFinally() {
2147 if (this.errorHandler) {
2148 this.body.off("error", this.errorHandler);
2149 this.errorHandler = null;
2150 }
2151 if (this.endHandler) {
2152 this.body.off("end", this.endHandler);
2153 this.endHandler = null;
2154 }
2155 }
2156 addHeader(key, value) {
2157 processHeader(this, key, value);
2158 return this;
2159 }
2160 };
2161 _publishUpgradeHeaders = new WeakSet();
2162 publishUpgradeHeaders_fn = function(statusCode, headers, statusText) {
2163 if (channels.headers.hasSubscribers) {
2164 channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
2165 }
2166 };
2167 _publishUpgradeTrailers = new WeakSet();
2168 publishUpgradeTrailers_fn = function() {
2169 if (channels.trailers.hasSubscribers) {

Callers 2

constructorMethod · 0.70
addHeaderMethod · 0.70

Calls 3

isValidHTTPTokenFunction · 0.70
isValidHeaderValueFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected