-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACP-3963 Algolia Event-Based Features. (#11158)
ACP-3963 Algolia Event-Based Features.
- Loading branch information
Showing
8 changed files
with
135 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. | ||
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. | ||
*/ | ||
|
||
namespace Spryker\Shared\KernelApp; | ||
|
||
use Spryker\Shared\Kernel\AbstractBundleConfig; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class KernelAppConfig extends AbstractBundleConfig | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected const COOKIE_HEADER = 'Cookie'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected const CONTENT_TYPE_HEADER = 'Content-Type'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected const CONTENT_TYPE_HEADER_VALUE = 'application/json'; | ||
|
||
/** | ||
* Specification: | ||
* - Returns an array of default headers to be used in HTTP requests. | ||
* - The array keys represent the header names. | ||
* - The array values represent the header values. | ||
* - The default headers include a 'Content-Type' header with the value 'application/json' and Cookie for zdebug session.. | ||
* - If a header already exists in the request, it will not be overridden. | ||
* | ||
* @api | ||
* | ||
* @return array<string, string> | ||
*/ | ||
public function getDefaultHeaders(): array | ||
{ | ||
$headers = [ | ||
static::CONTENT_TYPE_HEADER => static::CONTENT_TYPE_HEADER_VALUE, | ||
]; | ||
|
||
$request = Request::createFromGlobals(); | ||
if ($request->cookies->has('XDEBUG_SESSION')) { | ||
$headers[static::COOKIE_HEADER] = sprintf('XDEBUG_SESSION=%s', $request->cookies->get('XDEBUG_SESSION')); | ||
} | ||
|
||
return $headers; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters