forwardemail / forwardemail/superagent

Can't send secure cookies over app request

Open
#1,507 1 comment 2 reactions 0 assignees View on GitHub
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

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.