Commit 86a81e1
committed
feat: add User-Agent header to HTTP/HTTPS schema fetch requests
Include a well-formed RFC 9110-compliant User-Agent on all direct xhr calls
when fetching schemas over HTTP or HTTPS:
yaml-language-server/<version> (RedHat) node/<nodeVersion> (<platform>)
The server version is read from YAML_LANGUAGE_SERVER_VERSION, the Node.js
version from process.versions.node, and the platform from process.platform.
All three are guarded with typeof-process checks for browser/web worker
safety, falling back to 'unknown' for the version and omitting the runtime
and platform tokens entirely in non-Node environments.1 parent 0ae5603 commit 86a81e1
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
0 commit comments