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

fix(dao) select NULL fields as nil from the proxy #3714

Merged
merged 2 commits into from
Aug 20, 2018

Commits on Aug 17, 2018

  1. feat(db) add options.nulls to request explicit nulls from the DAO

    Minimal changes to add a { nulls = true } options argument to the new
    DAO, so that by default it returns Lua `nil` on null values, but can
    also return explicit `ngx.null` upon request. Adjusts the Admin API
    endpoint generator to pass this option, and also the router (so that
    code changes to the router at this point are minimal).
    
    Fix #3609
    Fix #3617
    hishamhm authored and thibaultcha committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    735314c View commit details
    Browse the repository at this point in the history
  2. refactor(runloop) do not select Services/Routes with nulls

    When reading from the proxy, we do not wish to retrieve unset columns as
    `ngx.null` for backwards-compatibility reasons. That is now the default
    for all plugins since 735314c (parent commit), for plugins, and it is
    now for the runloop as well.
    
    Context: retrieving unset columns as `nil` instead of `ngx.null` allows
    for backwards-compatibility with existing plugins. An example of this is
    authentication plugins retrieving the authenticated Consumer, and
    injecting its fields as headers into the upstream request (e.g.
    `X-Consumer-Username`). When such fields are unset, the following
    headers were sent upstream: `X-Consumer-Username: userdata: NULL`
    instead of no header at all (or worse, producing HTTP 500 errors).
    thibaultcha committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    ec61c1b View commit details
    Browse the repository at this point in the history