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

ERR_HTTP_TRAILER_INVALID #266

Open
cooye opened this issue Oct 5, 2022 · 1 comment
Open

ERR_HTTP_TRAILER_INVALID #266

cooye opened this issue Oct 5, 2022 · 1 comment

Comments

@cooye
Copy link

cooye commented Oct 5, 2022

Line 1074 is throwing this error when certain websites are accessed. I was able to finally see that it was this line by adding a try catch block around it so the proxy program I was using could log it otherwise an uncaughtException would occur and make it hard to debug. I propose the simple try catch block around this section to capture this error.

image

try {
        ctx.proxyToClientResponse.writeHead(ctx.serverToProxyResponse.statusCode, Proxy.filterAndCanonizeHeaders(ctx.serverToProxyResponse.headers));
        ctx.responseFilters.push(new ProxyFinalResponseFilter(self, ctx));
        var prevResponsePipeElem = ctx.serverToProxyResponse;
        ctx.responseFilters.forEach(function(filter) {
          filter.on('error', self._onError.bind(self, 'RESPONSE_FILTER_ERROR', ctx));
          prevResponsePipeElem = prevResponsePipeElem.pipe(filter);
        });	
} catch (e) {		
	return self._onError('ON_RESPONSEHEADERS_ERROR_WRITE',ctx,e);		
}
@cooye
Copy link
Author

cooye commented Oct 5, 2022

Line 836 was prior to some formatting changes I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant