fix: remove explicit Content-Type header in file upload (#11231)

The Content-Type header was removed from the fetch request when uploading files. This change may allow the server to infer the correct content type or handle uploads more flexibly.
This commit is contained in:
Pleasure1234 2025-11-10 15:28:38 +00:00 committed by GitHub
parent c1fa24522d
commit ce5d46bfc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -275,15 +275,10 @@ export default class MineruPreprocessProvider extends BasePreprocessProvider {
try { try {
const fileBuffer = await fs.promises.readFile(filePath) const fileBuffer = await fs.promises.readFile(filePath)
// https://mineru.net/apiManage/docs
const response = await net.fetch(uploadUrl, { const response = await net.fetch(uploadUrl, {
method: 'PUT', method: 'PUT',
body: fileBuffer, body: fileBuffer
headers: {
'Content-Type': 'application/pdf'
}
// headers: {
// 'Content-Length': fileBuffer.length.toString()
// }
}) })
if (!response.ok) { if (!response.ok) {