Allow `getNodeInfo` to pass native fetch options (or just custom request headers?)
This is useful when you want to customize the behavior more than normal fetch, such as adding custom headers or setting AbortController.
Specifically, there are use cases such as specifying User-Agent header to avoid firewalls (e.g. Cloudflare).
First, we created an option to set the User-Agent header. If you don't give any options, all HTTP requests that Fedify makes will have the User-Agent header as shown below (the values in the parentheses vary depending on the JavaScript runtime):
Fedify/1.3.0 (Deno/2.0.4)
In functions like getNodeInfo() or createFederation(), if you pass the userAgent option like this: { software: "MyApp/1.0.0", url: "https://example.com/" }, it will create a User-Agent like the one below:
MyApp/1.0.0 (Fedify/1.3.0; Deno/2.0.4; +https://example.com/)
Alternatively, if you give the userAgent option a string at all, it will use the entire string as the value of the User-Agent header.
We also added the -u/--user-agent option to the fedify lookup and fedify node commands to allow custom User-Agent headers to be used.
These changes will be coming in Fedify 1.3.0.
@dahlia This issue has been assigned for over two weeks without updates. Please provide a status update, or unassign yourself if you're unable to continue working on it.
@dahlia This issue has been assigned for over two weeks without updates. Please provide a status update, or unassign yourself if you're unable to continue working on it.