mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-29 04:10:11 +00:00
chore: fix pocketbase workflows
Some checks are pending
Set state to is_deleted in pocketbase / delete-pocketbase-entry (push) Waiting to run
Update script timestamp on .sh changes / update-script-timestamp (push) Waiting to run
Auto Update .app-files / update-app-files (push) Has been skipped
Create Changelog Pull Request / update-changelog-pull-request (push) Has been skipped
Some checks are pending
Set state to is_deleted in pocketbase / delete-pocketbase-entry (push) Waiting to run
Update script timestamp on .sh changes / update-script-timestamp (push) Waiting to run
Auto Update .app-files / update-app-files (push) Has been skipped
Create Changelog Pull Request / update-changelog-pull-request (push) Has been skipped
This commit is contained in:
parent
20c4657f39
commit
192e2950e7
3 changed files with 35 additions and 11 deletions
10
.github/workflows/delete-pocketbase-entry-on-removal.yml
generated
vendored
10
.github/workflows/delete-pocketbase-entry-on-removal.yml
generated
vendored
|
|
@ -75,7 +75,8 @@ jobs:
|
|||
const http = require('http');
|
||||
const url = require('url');
|
||||
|
||||
function request(fullUrl, opts) {
|
||||
function request(fullUrl, opts, redirectCount) {
|
||||
redirectCount = redirectCount || 0;
|
||||
return new Promise(function(resolve, reject) {
|
||||
const u = url.parse(fullUrl);
|
||||
const isHttps = u.protocol === 'https:';
|
||||
|
|
@ -90,6 +91,13 @@ jobs:
|
|||
if (body) options.headers['Content-Length'] = Buffer.byteLength(body);
|
||||
const lib = isHttps ? https : http;
|
||||
const req = lib.request(options, function(res) {
|
||||
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
||||
if (redirectCount >= 5) return reject(new Error('Too many redirects from ' + fullUrl));
|
||||
const redirectUrl = url.resolve(fullUrl, res.headers.location);
|
||||
res.resume();
|
||||
resolve(request(redirectUrl, opts, redirectCount + 1));
|
||||
return;
|
||||
}
|
||||
let data = '';
|
||||
res.on('data', function(chunk) { data += chunk; });
|
||||
res.on('end', function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue