Skip to content

content_by_lua_file should not return 404 if file permission denied #1992

Closed
@jizhuozhi

Description

@jizhuozhi

There are three situations in opening a file in the Linux file system

  1. Open successfully and execute
  2. The file exists but has no permissions
  3. The file does not exist

In some cases, developers may set wrong permissions when deploying lua scripts. At this time, content_by_lua_file will directly return 404, which is inappropriate. It stands to reason that it should return 403 or other 5xx series exception codes. , which makes it easier for us to use other anomaly detection systems to identify anomalies.

However, in order to be compatible with the old version, the configuration of the status code in both cases of not found and no permission can be provided, and both are set to 404 by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions