Code Monkey home page Code Monkey logo

fc-http's Issues

GET return corrupted binary files

when trying to return a binary file (20KB) to the caller. Caller side received corrupted binary file (35KB).
test-fc-http.zip

can be repro using attached modified sample project. under GET /file/:filepath endpoint.

to repro, try calling GET /file/data.jpg
the return image file becomes invalid.

no problem when returning text files.

have tried to set the binary flag as such, but none of the suggested options solve the above issue.

// option 1:
exports.handler = serverless(app);

// option 2:
exports.handler = serverless(app, {
  binary: false     // true / false doesn't matter, problem still exists
});

// option 3:
exports.handler = serverless(app, {
  binary: ['image/*', 'application/octet-stream']
});

req.headers['x-forwarded-for'] is missing

I would usually get the remote IP from value of req.headers['x-forwarded-for'] when my code is running in FC custom runtime.

but when using the Nodejs runtime via the fc-http wrapper, this value is undefined.

it would be good if it can be consistent with the usage of other runtimes like FC custom (I can also get it when running in AWS lambda through the serverless-http wrapper).

if not, what is your advice on how to get it (preferably an official method that will be persistent in future implementations).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.