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

[Bug?] Proxy request causes infinite loop #2

Open
LostMyCode opened this issue Dec 18, 2022 · 0 comments
Open

[Bug?] Proxy request causes infinite loop #2

LostMyCode opened this issue Dec 18, 2022 · 0 comments

Comments

@LostMyCode
Copy link

If you add a handler that has proxy option like this

FakeXMLHttpRequest.addHandler({
    url: /projects\/(.*)\/services\/lostmycode/,
    proxy: (url, data) => {
        return "http://localhost:9090/" + url;
    }
});

you will get maximum call stack size exceeded error

Uncaught RangeError: Maximum call stack size exceeded
    at FakeXMLHttpRequest.open

So i think Line#166 should be new window.OriginalXHR() instead of new XMLHttpRequest()

if (typeof url === 'string' && url.length > 0) {
var proxyRequest = new XMLHttpRequest();
proxyRequest.onreadystatechange = function() {

new window.OriginalXHR() worked for me

@thommyhh Sry for mentioning your old project. It's been 4 or 5 years since the last update, but I just wanted to help to improve this repo coz it really nice and helped me so much. Thank you.

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