mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 13:33:25 +00:00
return body if body type is undefined
This commit is contained in:
@@ -16,7 +16,7 @@ export interface Request extends BaseRequest {
|
|||||||
readHeaders?: Record<string, string>;
|
readHeaders?: Record<string, string>;
|
||||||
url: string;
|
url: string;
|
||||||
body?: any;
|
body?: any;
|
||||||
bodyType: 'string' | 'FormData' | 'URLSearchParams' | 'object';
|
bodyType?: 'string' | 'FormData' | 'URLSearchParams' | 'object';
|
||||||
}
|
}
|
||||||
|
|
||||||
type Response<T> = BaseResponse<{
|
type Response<T> = BaseResponse<{
|
||||||
@@ -49,7 +49,7 @@ const mapBodyToFetchBody = (body: Request['body'], bodyType: Request['bodyType']
|
|||||||
if (bodyType === 'string') {
|
if (bodyType === 'string') {
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
return undefined;
|
return body;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handler: PlasmoMessaging.MessageHandler<Request, Response<any>> = async (req, res) => {
|
const handler: PlasmoMessaging.MessageHandler<Request, Response<any>> = async (req, res) => {
|
||||||
|
Reference in New Issue
Block a user