EXXETA / EXXETA/openapi-cop

302 redirect causes max redirects error

Open
#387 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
370
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Sorry to spam the repo with issues.

The response that is returned to the proxy is:
```
< HTTP/1.1 302 FOUND
< Server: Werkzeug/2.2.2 Python/3.10.7
< Date: Mon, 26 Sep 2022 22:33:59 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 669
< Location: $REDURECT_URL
< Vary: Cookie
< Set-Cookie: session=$COOKIE HttpOnly; Path=/
< Connection: close
<

Redirecting...

Redirecting...


You should be redirected automatically to the target URL: $REDURECT_URL. If not, click the link.
```

However, when proxied through openapi-cop, I get this error `Error: Exceeded maxRedirects. Probably stuck in a redirect loop $REDIRECT_URL`. With the server outputting this:

```
(node:8) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 pipe listeners added. Use emitter.setMaxListeners() to increase limit
2022-09-26T22:34:53.451Z openapi-cop:proxy Validation results [GET /api/user/signin]
{
"request": {
"valid": true,
"errors": null
}
}
2022-09-26T22:34:53.456Z openapi-cop:proxy Could not send request: Error: Exceeded maxRedirects. Probably stuck in a redirect loop $REDIRECT_URL
```

This makes the proxy unusable for endpoints that redirect.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.