Add edit-info API (v2)

Update frontend ui

Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
Joe Ma 2025-08-04 13:03:57 +08:00
parent 0301a9d9f8
commit a2347f9f94
No known key found for this signature in database
GPG key ID: 7A0ECF5F5EDC587F
6 changed files with 115 additions and 21 deletions

View file

@ -21,7 +21,7 @@ import { sha256 } from 'js-sha256';
import { Router, error, cors } from 'itty-router';
import { ERequest, Env } from './types';
import { serve_static } from './proxy';
import { check_password_rules, get_paste_info, get_basic_auth, gen_id } from './utils';
import { check_password_rules, get_paste_info, get_auth, gen_id } from './utils';
import constants, { fetch_constant } from './constant';
import { get_presign_url, router as large_upload } from './api/large_upload';
import v2api from './v2/api';
@ -316,7 +316,7 @@ router.get('/:uuid/:option?', async (request, env, ctx) => {
// Check password if needed
if (descriptor.password !== undefined) {
if (headers.has('Authorization')) {
let cert = get_basic_auth(headers);
let cert = get_auth(headers, 'Basic');
// Error occurred when parsing the header
if (cert === null) {
return new Response('Invalid Authorization header.', {