mirror of
https://github.com/langchain-ai/langgraphjs-api.git
synced 2026-07-19 13:25:54 -04:00
Auto-infer to text/plain
This commit is contained in:
@@ -18,6 +18,21 @@ import { store as graphStore } from "./storage/store.mjs";
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
// This is used to match the behavior of the original LangGraph API
|
||||
// where the content-type is not being validated. Might be nice
|
||||
// to warn about this in the future and throw an error instead.
|
||||
app.use(async (c, next) => {
|
||||
if (
|
||||
c.req.header("content-type")?.startsWith("text/plain") &&
|
||||
c.req.method !== "GET" &&
|
||||
c.req.method !== "OPTIONS"
|
||||
) {
|
||||
c.req.raw.headers.set("content-type", "application/json");
|
||||
}
|
||||
|
||||
await next();
|
||||
});
|
||||
|
||||
app.use(cors());
|
||||
app.use(requestLogger());
|
||||
|
||||
|
||||
@@ -2240,7 +2240,7 @@ describe("multitasking", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe.only("RemoteGraph", () => {
|
||||
describe("RemoteGraph", () => {
|
||||
it.concurrent("stream values", async () => {
|
||||
const graph = new RemoteGraph({
|
||||
graphId: "agent",
|
||||
|
||||
Reference in New Issue
Block a user