Commit e9f3cc90 authored by nanahira's avatar nanahira

fix

parent 3e310b3e
...@@ -33,7 +33,7 @@ export default class PicApi extends StarterPlugin(PicApiConfig) { ...@@ -33,7 +33,7 @@ export default class PicApi extends StarterPlugin(PicApiConfig) {
async handle(ctx: KoaContext) { async handle(ctx: KoaContext) {
if (this.config.token) { if (this.config.token) {
let authorization = ctx.headers.authorization; let authorization = ctx.headers.authorization;
if (authorization.startsWith('Bearer ')) { if (authorization?.startsWith('Bearer ')) {
authorization = authorization.slice(7); authorization = authorization.slice(7);
} }
if (authorization !== this.config.token) { if (authorization !== this.config.token) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment