Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/main/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/main/index.js.map

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,7 @@ export async function downloadUpdateInstaller(config: VersionConfig): Promise<st
// resolve download url
let downloadLink: string | null = null;
if (!config.updateUrl.endsWith('.exe')) {
// Use native fetch - the download page rejects requests made through
// @actions/http-client >= 3.0.1 with a 403, regardless of user agent.
const res = await fetch(config.updateUrl, {
headers: {
'accept': 'text/html,application/xhtml+xml',
'user-agent': 'tediousjs/setup-sqlserver (+https://github.com/tediousjs/setup-sqlserver)',
},
});
const res = await fetch(config.updateUrl);
if (res.ok) {
const body = await res.text();
const [, link] = body.match(/\s+href\s*=\s*["'](https:\/\/download\.microsoft\.com\/.*\.exe)['"]/) ?? [];
Expand Down