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

[2.0] Drop the trust_x_forwarded_proto configuration option #599

Merged
merged 1 commit into from
May 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/Raven/ClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
*
* @method int getSendAttempts()
* @method setSendAttempts(int $attemptsCount)
* @method bool isTrustXForwardedProto()
* @method setIsTrustXForwardedProto(bool $value)
* @method string[] getPrefixes()
* @method setPrefixes(array $prefixes)
* @method bool getSerializeAllObjects()
Expand Down
24 changes: 0 additions & 24 deletions lib/Raven/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,6 @@ public function setSendAttempts($attemptsCount)
$this->options = $this->resolver->resolve($options);
}

/**
* Checks whether the X-FORWARDED-PROTO header should be trusted.
*
* @return bool
*/
public function isTrustXForwardedProto()
{
return $this->options['trust_x_forwarded_proto'];
}

/**
* Sets whether the X-FORWARDED-PROTO header should be trusted.
*
* @param bool $value The value of the option
*/
public function setIsTrustXForwardedProto($value)
{
$options = array_merge($this->options, ['trust_x_forwarded_proto' => $value]);

$this->options = $this->resolver->resolve($options);
}

/**
* Gets the prefixes which should be stripped from filenames to create
* relative paths.
Expand Down Expand Up @@ -642,7 +620,6 @@ private function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'send_attempts' => 6,
'trust_x_forwarded_proto' => false,
'prefixes' => explode(PATH_SEPARATOR, get_include_path()),
'serialize_all_object' => false,
'sample_rate' => 1,
Expand All @@ -667,7 +644,6 @@ private function configureOptions(OptionsResolver $resolver)
]);

$resolver->setAllowedTypes('send_attempts', 'int');
$resolver->setAllowedTypes('trust_x_forwarded_proto', 'bool');
$resolver->setAllowedTypes('prefixes', 'array');
$resolver->setAllowedTypes('serialize_all_object', 'bool');
$resolver->setAllowedTypes('sample_rate', ['int', 'float']);
Expand Down
1 change: 0 additions & 1 deletion tests/ClientBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ public function testCallExistingMethodForwardsCallToConfiguration($setterMethod,
public function optionsDataProvider()
{
return [
['setIsTrustXForwardedProto', true],
['setPrefixes', ['foo', 'bar']],
['setSerializeAllObjects', false],
['setSampleRate', 0.5],
Expand Down
1 change: 0 additions & 1 deletion tests/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public function optionsDataProvider()
{
return [
['send_attempts', 1, 'getSendAttempts', 'setSendAttempts'],
['trust_x_forwarded_proto', false, 'isTrustXForwardedProto', 'setIsTrustXForwardedProto'],
['prefixes', ['foo', 'bar'], 'getPrefixes', 'setPrefixes'],
['serialize_all_object', false, 'getSerializeAllObjects', 'setSerializeAllObjects'],
['sample_rate', 0.5, 'getSampleRate', 'setSampleRate'],
Expand Down