Loading CHANGES.md +5 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ Version 1.3.6 To be released. - Fixed a bug where `getUserAgent()` function had returned a `User-Agent` string with a wrong JavaScript runtime name on Node.js. [[#203]] [#203]: https://github.com/fedify-dev/fedify/issues/203 Version 1.3.5 ------------- Loading src/deno.json +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ }, "imports": { "@cfworker/json-schema": "npm:@cfworker/json-schema@^2.0.1", "@david/which-runtime": "jsr:@david/which-runtime@^0.2.0", "@david/which-runtime": "jsr:@david/which-runtime@^0.2.1", "@deno/dnt": "jsr:@deno/dnt@0.41.2", "@fedify/fedify": "./mod.ts", "@fedify/fedify/federation": "./federation/mod.ts", Loading src/runtime/docloader.test.ts +2 −1 Original line number Diff line number Diff line import { isDeno } from "@david/which-runtime"; import { assertEquals, assertRejects, assertThrows } from "@std/assert"; import * as mf from "mock_fetch"; import process from "node:process"; Loading Loading @@ -550,7 +551,7 @@ test("kvCache()", async (t) => { }); test("getUserAgent()", () => { if ("Deno" in globalThis) { if (isDeno) { assertEquals( getUserAgent(), `Fedify/${metadata.version} (Deno/${Deno.version.deno})`, Loading src/runtime/docloader.ts +3 −4 Original line number Diff line number Diff line import { isDeno, isNode } from "@david/which-runtime"; import { HTTPHeaderLink } from "@hugoalh/http-header-link"; import { getLogger } from "@logtape/logtape"; import process from "node:process"; Loading Loading @@ -520,12 +521,10 @@ export function getUserAgent( { software, url }: GetUserAgentOptions = {}, ): string { const fedify = `Fedify/${metadata.version}`; const runtime = "Deno" in globalThis ? `Deno/${Deno.version.deno}` : "Bun" in globalThis const runtime = isDeno ? `Deno/${Deno.version.deno}` : "Bun" in globalThis // @ts-ignore: `Bun` is a global variable in Bun ? `Bun/${Bun.version}` : "process" in globalThis : isNode ? `Node.js/${process.version}` : null; const userAgent = software == null ? [fedify] : [software, fedify]; Loading Loading
CHANGES.md +5 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ Version 1.3.6 To be released. - Fixed a bug where `getUserAgent()` function had returned a `User-Agent` string with a wrong JavaScript runtime name on Node.js. [[#203]] [#203]: https://github.com/fedify-dev/fedify/issues/203 Version 1.3.5 ------------- Loading
src/deno.json +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ }, "imports": { "@cfworker/json-schema": "npm:@cfworker/json-schema@^2.0.1", "@david/which-runtime": "jsr:@david/which-runtime@^0.2.0", "@david/which-runtime": "jsr:@david/which-runtime@^0.2.1", "@deno/dnt": "jsr:@deno/dnt@0.41.2", "@fedify/fedify": "./mod.ts", "@fedify/fedify/federation": "./federation/mod.ts", Loading
src/runtime/docloader.test.ts +2 −1 Original line number Diff line number Diff line import { isDeno } from "@david/which-runtime"; import { assertEquals, assertRejects, assertThrows } from "@std/assert"; import * as mf from "mock_fetch"; import process from "node:process"; Loading Loading @@ -550,7 +551,7 @@ test("kvCache()", async (t) => { }); test("getUserAgent()", () => { if ("Deno" in globalThis) { if (isDeno) { assertEquals( getUserAgent(), `Fedify/${metadata.version} (Deno/${Deno.version.deno})`, Loading
src/runtime/docloader.ts +3 −4 Original line number Diff line number Diff line import { isDeno, isNode } from "@david/which-runtime"; import { HTTPHeaderLink } from "@hugoalh/http-header-link"; import { getLogger } from "@logtape/logtape"; import process from "node:process"; Loading Loading @@ -520,12 +521,10 @@ export function getUserAgent( { software, url }: GetUserAgentOptions = {}, ): string { const fedify = `Fedify/${metadata.version}`; const runtime = "Deno" in globalThis ? `Deno/${Deno.version.deno}` : "Bun" in globalThis const runtime = isDeno ? `Deno/${Deno.version.deno}` : "Bun" in globalThis // @ts-ignore: `Bun` is a global variable in Bun ? `Bun/${Bun.version}` : "process" in globalThis : isNode ? `Node.js/${process.version}` : null; const userAgent = software == null ? [fedify] : [software, fedify]; Loading