Skip to content

Check if module has been registered when referenced by a file handler #178

@wagnert

Description

@wagnert

Actually there is a chance to misconfigure file handlers by specifying the name of a not existing module, like

<fileHandlers>
    <fileHandler name="<INVALID_MODULE_NAME>" extension=".do" />
</fileHandlers>

This actually would invoke the ProxyModule which triggers an error because of a missing upstream configuration (by default, appserver.xml has NO upstream configuration).

invalid configuration

To avoid misconfigurations, the CoreModule should check, if the module, a file handler references is available or not. If not, a 500 error should be triggered and a debug message should be written to the error log.

Additional Optimization:

It would make sense, to NOT hardcode module names, but instead make them configurable in appserver.xml like

<modules>
    <module name="vhost" type="\AppserverIo\WebServer\Modules\VirtualHostModule"/>
    <module name="env" type="\AppserverIo\WebServer\Modules\EnvironmentVariableModule" />
    ...
</modules>

These names can then be used for the file handler configuration later on, without the need to know the modules names from the source code.

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