Skip to content

Commit

Permalink
fix: bug in setting cacheTime for object uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
inian committed Mar 17, 2021
1 parent a6fbdee commit 9991eef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const build = (opts: buildOpts = {}): FastifyInstance => {
const app = fastify(opts)
app.register(fastifyMultipart, {
limits: {
fields: 0,
fields: 10,
fileSize: 50 * 1024 * 1024,
files: 1,
},
Expand Down
2 changes: 1 addition & 1 deletion src/routes/object/createObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default async function routes(fastify: FastifyInstance) {
// https://github.com/fastify/fastify-multipart/issues/162
/* @ts-expect-error: https://github.com/aws/aws-sdk-js-v3/issues/2085 */
const cacheTime = data.fields.cacheControl?.value
const cacheControl: string = `max-age=${cacheTime}` ?? 'no-cache'
const cacheControl: string = cacheTime ? `max-age=${cacheTime}` : 'no-cache'

const { bucketName } = request.params
const objectName = request.params['*']
Expand Down
1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ interface jwtInterface {
}

export function getPostgrestClient(jwt: string): PostgrestClient {
// @todo in kps, can we just ping localhost?
const postgrest = new PostgrestClient(postgrestURL, {
headers: {
apiKey: anonKey,
Expand Down

0 comments on commit 9991eef

Please # to comment.