mirror of
https://github.com/rikkaneko/paste.git
synced 2025-08-11 08:25:33 +01:00
Add edit-info API (v2)
Update frontend ui Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
0301a9d9f8
commit
a2347f9f94
6 changed files with 115 additions and 21 deletions
|
@ -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.', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue