diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index 537af59b..6bf42ddc 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -46,7 +46,7 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install pnpm - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 + uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 with: version: 10 - name: Generate pnpm file diff --git a/.github/workflows/versions.yml b/.github/workflows/versions.yml index e9aabd78..6aa86df1 100644 --- a/.github/workflows/versions.yml +++ b/.github/workflows/versions.yml @@ -158,7 +158,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel] node-version-file: - [.nvmrc, .tool-versions, .tool-versions-node, package.json, mise.toml] + [.nvmrc, .tool-versions, .tool-versions-node, package.json] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup node from node version file diff --git a/.licenses/npm/brace-expansion.dep.yml b/.licenses/npm/brace-expansion.dep.yml index fd7e18fe..f40e8707 100644 --- a/.licenses/npm/brace-expansion.dep.yml +++ b/.licenses/npm/brace-expansion.dep.yml @@ -1,6 +1,6 @@ --- name: brace-expansion -version: 5.0.9 +version: 5.0.8 type: npm summary: Brace expansion as known from sh/bash homepage: diff --git a/.licenses/npm/smol-toml.dep.yml b/.licenses/npm/smol-toml.dep.yml deleted file mode 100644 index e12de58d..00000000 --- a/.licenses/npm/smol-toml.dep.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: smol-toml -version: 1.7.1 -type: npm -summary: A small, fast, and correct TOML parser/serializer -homepage: -license: bsd-3-clause -licenses: -- sources: LICENSE - text: | - Copyright (c) Squirrel Chat et al., All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -notices: [] diff --git a/.licenses/npm/undici.dep.yml b/.licenses/npm/undici.dep.yml index b339a448..c46a5c7b 100644 --- a/.licenses/npm/undici.dep.yml +++ b/.licenses/npm/undici.dep.yml @@ -1,6 +1,6 @@ --- name: undici -version: 6.28.0 +version: 6.27.0 type: npm summary: An HTTP/1.1 client, written from scratch for Node.js homepage: https://undici.nodejs.org diff --git a/README.md b/README.md index bd0edb87..e4158422 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ See [action.yml](action.yml) # Examples: 12.x, 10.15.1, >=10.15.0, lts/Hydrogen, 16-nightly, latest, node node-version: '' - # File containing the version Spec of the version to use. Examples: package.json, mise.toml, .nvmrc, .node-version, .tool-versions. + # File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions. # If node-version and node-version-file are both provided the action will use version from node-version. node-version-file: '' diff --git a/__tests__/data/mise.toml b/__tests__/data/mise.toml deleted file mode 100644 index 5a012336..00000000 --- a/__tests__/data/mise.toml +++ /dev/null @@ -1,2 +0,0 @@ -[tools] -node = "24.0.0" diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 99cc0c86..382d8b19 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -1,15 +1,16 @@ import { - afterAll, - afterEach, - beforeEach, + jest, describe, - expect, it, - jest + expect, + beforeEach, + afterEach, + afterAll } from '@jest/globals'; +import {fileURLToPath} from 'url'; import fs from 'fs'; import path from 'path'; -import {fileURLToPath} from 'url'; +import osm from 'os'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -196,11 +197,6 @@ describe('main tests', () => { ${'{"engines": {"node": "17.0.0"}}'} | ${'17.0.0'} ${'{"devEngines": {"runtime": {"name": "node", "version": "22.0.0"}}}'} | ${'22.0.0'} ${'{"devEngines": {"runtime": [{"name": "bun"}, {"name": "node", "version": "22.0.0"}]}}'} | ${'22.0.0'} - ${'[tools]\ngo="latest"\nnode = "24.10"'} | ${'24.10'} - ${'[tools]\nnode = "22.12"'} | ${'22.12'} - ${'[tools]\ngo="latest"\nnode = "24.10"'} | ${'24.10'} - ${'[tools]\nnode = { version = "22.20" }'} | ${'22.20'} - ${'[tools]\nnode = { postinstall = "corepack enable" }'} | ${null} `.it('parses "$contents"', ({contents, expected}: any) => { const existsSpy = jest.spyOn(fs, 'existsSync'); existsSpy.mockImplementation(() => true); diff --git a/action.yml b/action.yml index 31057efa..dc1cefd5 100644 --- a/action.yml +++ b/action.yml @@ -5,7 +5,7 @@ inputs: node-version: description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.' node-version-file: - description: 'File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions, mise.toml.' + description: 'File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions.' architecture: description: 'Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.' check-latest: diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index df712a2c..501e837f 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -13899,13 +13899,7 @@ function processHeader (request, key, val) { } else if (typeof val[i] === 'object') { throw new InvalidArgumentError(`invalid ${key} header`) } else { - // Coerce primitives (and reject unsafe coercions such as functions - // with a crafted toString/Symbol.toPrimitive). - const str = `${val[i]}` - if (!isValidHeaderValue(str)) { - throw new InvalidArgumentError(`invalid ${key} header`) - } - arr.push(str) + arr.push(`${val[i]}`) } } val = arr @@ -13916,12 +13910,7 @@ function processHeader (request, key, val) { } else if (val === null) { val = '' } else { - // Coerce primitives (and reject unsafe coercions such as functions - // with a crafted toString/Symbol.toPrimitive). val = `${val}` - if (!isValidHeaderValue(val)) { - throw new InvalidArgumentError(`invalid ${key} header`) - } } if (headerName === 'host') { @@ -15293,7 +15282,6 @@ const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, RequestAbortedError, - InvalidArgumentError, HeadersTimeoutError, HeadersOverflowError, SocketError, @@ -16277,16 +16265,8 @@ function writeH1 (client, request) { } body = bodyStream.stream contentLength = bodyStream.length - } else if (util.isBlobLike(body) && request.contentType == null) { - const contentType = body.type - if (contentType) { - const contentTypeValue = `${contentType}` - if (!util.isValidHeaderValue(contentTypeValue)) { - util.errorRequest(client, request, new InvalidArgumentError('invalid content-type header')) - return false - } - headers.push('content-type', contentTypeValue) - } + } else if (util.isBlobLike(body) && request.contentType == null && body.type) { + headers.push('content-type', body.type) } if (body && typeof body.read === 'function') { @@ -19759,28 +19739,6 @@ function calculateRetryAfterHeader (retryAfter) { return new Date(retryAfter).getTime() - current } -function validatePartialResponseContentLength (headers, range, statusCode, retryCount) { - const contentLength = headers['content-length'] - if (contentLength == null) { - return null - } - - if (!Number.isFinite(range.start) || !Number.isFinite(range.end)) { - return null - } - - const length = Number(contentLength) - const expectedLength = range.end - range.start + 1 - if (!Number.isFinite(length) || length !== expectedLength) { - return new RequestRetryError('Content-Length mismatch', statusCode, { - headers, - data: { count: retryCount } - }) - } - - return null -} - class RetryHandler { constructor (opts, handlers) { const { retryOptions, ...dispatchOpts } = opts @@ -19995,12 +19953,6 @@ class RetryHandler { return false } - const contentLengthError = validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount) - if (contentLengthError != null) { - this.abort(contentLengthError) - return false - } - const { start, size, end = size - 1 } = contentRange assert(this.start === start, 'content-range mismatch') @@ -20024,12 +19976,6 @@ class RetryHandler { ) } - const contentLengthError = validatePartialResponseContentLength(headers, range, statusCode, this.retryCount) - if (contentLengthError != null) { - this.abort(contentLengthError) - return false - } - const { start, size, end = size - 1 } = range assert( start != null && Number.isFinite(start), @@ -24274,7 +24220,7 @@ function validateCookiePath (path) { if ( code < 0x20 || // exclude CTLs (0-31) - code > 0x7E || // exclude DEL and non-ascii + code === 0x7F || // DEL code === 0x3B // ; ) { throw new Error('Invalid cookie path') @@ -24283,80 +24229,16 @@ function validateCookiePath (path) { } /** - * ::= | - * - * ::= any one of the 52 alphabetic characters A through Z in - * upper case and a through z in lower case - * - * ::= any one of the ten digits 0 through 9r - * - * @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5 - * @param {number} code - */ -function isLetterOrDigit (code) { - return ( - (code >= 0x30 && code <= 0x39) || // 0-9 - (code >= 0x41 && code <= 0x5A) || // A-Z - (code >= 0x61 && code <= 0x7A) // a-z - ) -} - -/** - * Validates a cookie domain against the "preferred name syntax". - * - * ::= | " " - * ::=