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

security.txt file does not end with newline (carriage return) by default #1429

Closed
WilliamDEdwards opened this issue Mar 6, 2024 · 3 comments
Labels

Comments

@WilliamDEdwards
Copy link

Describe the bug

SEOmatic allows one to configure security.txt files. That file does not end with a newline (carriage return), unless it explicitly ends with an empty line. That causes the file to be invalid.

To reproduce

Steps to reproduce the behaviour:

  1. Log into Craft CMS' admin panel
  2. Navigate to SEOmatic -> Global SEO -> Security
  3. Set 'Security.txt Template' to a value that does not end with an empty line, such as:
Contact: mailto:[email protected]
Expires: {{ date('+1 year')|atom }}
Preferred-Languages: en, nl
Canonical: https://cyberfusion.io/.well-known/security.txt

The newline is added only when explicitly adding an empty line:

Contact: mailto:[email protected]
Expires: {{ date('+1 year')|atom }}
Preferred-Languages: en, nl
Canonical: https://cyberfusion.io/.well-known/security.txt

Expected behaviour

The security.txt file that SEOmatic generates should always end with a newline (carriage return). It's invalid otherwise.

Screenshots

N/A

Versions

  • Plugin version: 4.0.42
  • Craft version: 4.6.1
@khalwat
Copy link
Collaborator

khalwat commented Mar 6, 2024

So you would like SEOmatic to automatically add a newline if one is not present?

@WilliamDEdwards
Copy link
Author

So you would like SEOmatic to automatically add a newline if one is not present?

If we don’t want invalid security.txt files without relying on users to add an empty line to all their configurations (which, from a UX standpoint, is probably not great), then yes.

@khalwat
Copy link
Collaborator

khalwat commented Mar 6, 2024

Addressed in the above commits.

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop as 3.4.73”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v4 as 4.0.43”,

Then do a composer clear-cache && composer update

…..

Craft CMS 5:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v5 as 5.0.0-beta.6”,

Then do a composer clear-cache && composer update

@khalwat khalwat closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants