Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
fix(fota): fix upload getting stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Jan 11, 2021
1 parent 3278e54 commit 3b3ce5f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/aws/Cat/CatActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { CatMap } from './CatMap'
import { HistoricalButtonPresses } from '../../HistoricalButtonPresses/HistoricalButtonPresses'
import { CatLoader } from '../../Cat/CatLoader'
import { left, right } from 'fp-ts/lib/Either'
import { HttpRequest } from '@aws-sdk/protocol-http'

export const CatActions = ({ catId }: { catId: string }) => {
const [deleted, setDeleted] = useState(false)
Expand Down Expand Up @@ -59,6 +60,17 @@ export const CatActions = ({ catId }: { catId: string }) => {
credentials,
region,
})
// FIXME: remove when https://github.com/aws/aws-sdk-js-v3/issues/1800 is fixed
s3.middlewareStack.add(
(next) => async (args) => {
delete (args.request as HttpRequest).headers[
'content-type'
]
return next(args)
},
{ step: 'build' },
)

const avatarUploader = uploadAvatar({
s3,
bucketName: avatarBucketName,
Expand Down

0 comments on commit 3b3ce5f

Please sign in to comment.