forwardemail / forwardemail/superagent
Can't send secure cookies over app request
- Dominant language
- JavaScript
- Stars
- 16.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Sample code to reproduce
```
import * as supertest from "supertest";
import app from "../app";
// Koa2 app
const agent = supertest.agent(app.callback());
describe("basic auth test", () => {
test("login", async () => {
// Cookie gets assigned by server here (secure)
await request.post("/login").send({email: "1", password: "1"})
});
test("access restricted route", async () => {
// Cookie is not being sent to the server since the connection is not secure
await request.post("/restricted");
})
});
```
I understand the rationale if one is using external ips to test, but if one is using the app directly we should have an option to override this behavior and avoid using ugly workarounds.
Contributor guide
Assessment
This issue has not been assessed yet.