-
-
Notifications
You must be signed in to change notification settings - Fork 835
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
added powered-by-header #2618
added powered-by-header #2618
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I didn't know we needed but I love it! Everything works locally from testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be disabled using:
Flarum\Http\Middleware\FlarumPromotionHeader::disable()
in extend.php.
The Compat
extender is going away with stable, so no more callbacks in extend.php. I suppose it could also be done outside a callback, but I would prefer for extend.php
to remain just extenders. Instead, let's use the config.php.
I've refactored based on the review. You can now disable the promotion header in the <?php
return [
'url' => 'http://toby.local',
'debug' => true,
'promote' => false,
// ..
]; If the |
{ | ||
static::$enabled = false; | ||
$this->enabled = $config['promote'] ?? true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->enabled = $config['promote'] ?? true; | |
$this->enabled = $config['flarumPromotionalHeader'] ?? true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like that suggested name is a little long? I'm perfectly fine with simple "promote" if we did want to explain it more maybe "promotionHeader" or "poweredByHeader"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it!
can we also add the key to StoreConfig.php so that it's there by default ? |
Good point. It'll also be in the release announcement and config.php docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "promote" is too broad, "promoteFlarumHeader" or "promoteFlarum" might be better.
What about "promoHeader" |
Adds a
X-Powered-By
header. It can be disabled using:Flarum\Http\Middleware\FlarumPromotionHeader::disable()
in extend.php.