Use the configured default extension

Right now the code does not take defaultExtension into account.