Giter Club home page Giter Club logo

Comments (5)

agentzh avatar agentzh commented on August 22, 2024

@chirkin Please use the ngx_lua module instead. It is just a single line for your use case:

rewrite_by_lua 'ngx.req.read_body()';

Simple enough. Although ngx_lua is way more powerful than just that.

from echo-nginx-module.

chirkin avatar chirkin commented on August 22, 2024

@agentzh Thank you, it is really more powerful. I think the performance is not much affected.

from echo-nginx-module.

chirkin avatar chirkin commented on August 22, 2024

@agentzh I found that this solution has drawbacks. In particular postgres_escape function is called before than the ngx.req.read_body() processed. I need to protect sql query. Do you have any solutions?

from echo-nginx-module.

agentzh avatar agentzh commented on August 22, 2024

@chirkin Well, just use the ndk.set_var.set_quote_pgsql_str() API function in Lua to do the escaping. You'll need the ngx_set_misc module too. See

https://github.com/openresty/lua-nginx-module#ndkset_vardirective

https://github.com/openresty/set-misc-nginx-module#set_quote_pgsql_str

from echo-nginx-module.

chirkin avatar chirkin commented on August 22, 2024

@agentzh Bravo! Thank you!

from echo-nginx-module.

Related Issues (20)

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.