Skip to content

easymock server crashes on cancelled requests #69

@sascha-haenlein

Description

@sascha-haenlein

I was working on cancelling an open request and recognized that my easymock server always crashes with the following message when request gets cancelled:

_http_outgoing.js:492
    throw new Error('"value" required in setHeader("' + name + '", value)');
    ^

Error: "value" required in setHeader("x-forwarded-for", value)
    at validateHeader (_http_outgoing.js:492:11)
    at ClientRequest.setHeader (_http_outgoing.js:501:3)
    at new ClientRequest (_http_client.js:173:14)
    at Object.request (http.js:38:10)
    at exports.HttpProxy.HttpProxy.proxyRequest (E:\Projects\amino-dat-online\node_modules\easymock\node_modules\http-proxy\lib\node-http-proxy\http-proxy.js:247:39)
    at exports.RoutingProxy.RoutingProxy.proxyRequest (E:\Projects\amino-dat-online\node_modules\easymock\node_modules\http-proxy\lib\node-http-proxy\routing-proxy.js:239:9)
    at Timeout._onTimeout (E:\Projects\amino-dat-online\node_modules\easymock\lib\easymock.js:214:15)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)

That is how it can be caused:

mockserver config.json:

{
	"cors": true,
	"jsonp": false,
	"simulated-lag": 5000,
	"variables": {
	},
	"routes": [
	]
}

within any component:

let subject = new Subject<true>();

this.http.get('http://localhost:3000/mocks/data', {responseType: 'json'})
	.takeUntil(subject)
	.subscribe(
		(data) =>{
			this.responseData = data;
		},
		(err) =>{
		});

setTimeout(()=>{
	subject.next(true);
}, 1000);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions