Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fastify-compress] Not working with aws api gateway proxy+ #228

Closed
2 tasks done
thanhlq opened this issue Jun 10, 2022 · 3 comments · Fixed by #290
Closed
2 tasks done

[Fastify-compress] Not working with aws api gateway proxy+ #228

thanhlq opened this issue Jun 10, 2022 · 3 comments · Fixed by #290

Comments

@thanhlq
Copy link

thanhlq commented Jun 10, 2022

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.0.0

Plugin version

6.0.0

Node.js version

16.x

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

lambda

Description

When I register this pluggin I got no response data in browser (disable the plugin, it works).

I got this error report ERR_CONTENT_DECODING_FAILED.
(In firefix, the message says: Content Encoding Error).

Steps to Reproduce

  • Simple aws api gateway deploy with proxy++

lambda.js

import awsLambdaFastify from '@fastify/aws-lambda';
import app from './main.js';

const proxy = awsLambdaFastify(app)
const handler = (event, context, callback) => {
  context.callbackWaitsForEmptyEventLoop = false;
  return proxy(event, context, callback)
};

export {
  handler
}

app.js ("@fastify/compress": "^6.0.0",)

import mCompress from '@fastify/rate-limit'
 fastify.register(mCompress, {
     global: true,
     encodings: ['gzip', 'deflate']
 })

(Even I removed encodings, still not working).
(I run in localhost wihout any problems)

Expected Behavior

No response

@mcollina
Copy link
Member

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

@Uzlopak
Copy link
Contributor

Uzlopak commented Jul 13, 2022

You are importing mCompress from fastify-rate-limit and not from fastify-compress? Is this even correct?

@Uzlopak
Copy link
Contributor

Uzlopak commented Aug 6, 2022

Maybe fixed with fastify/aws-lambda-fastify#118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants