kopia lustrzana https://github.com/cloudflare/wildebeest
Merge pull request #92 from cloudflare/sven/revert
Revert "add content-type in image upload"pull/94/head
commit
1d5f4b0b0d
|
@ -29,7 +29,6 @@ export async function uploadImage(file: File, config: Config): Promise<URL> {
|
|||
method: 'POST',
|
||||
body: formData,
|
||||
headers: {
|
||||
'content-type': file.type,
|
||||
authorization: 'Bearer ' + config.apiToken,
|
||||
},
|
||||
})
|
||||
|
|
|
@ -12,10 +12,8 @@ const domain = 'cloudflare.com'
|
|||
describe('Mastodon APIs', () => {
|
||||
describe('media', () => {
|
||||
test('upload image creates object', async () => {
|
||||
globalThis.fetch = async (input: RequestInfo, data: any) => {
|
||||
globalThis.fetch = async (input: RequestInfo) => {
|
||||
if (input === 'https://api.cloudflare.com/client/v4/accounts/testaccountid/images/v1') {
|
||||
assert.equal(data.headers['content-type'], 'image/jpeg')
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
|
|
Ładowanie…
Reference in New Issue