@@ -371,13 +371,13 @@ If the client is not a web browser, then using an authorization header is the wa
371
371
The native implementation of EventSource doesn't allow specifying headers.
372
372
For example, authorization using Bearer token. In order to achieve that, use `a polyfill `_
373
373
374
- .. code-block :: javascript
374
+ .. code-block :: javascript
375
375
376
- const es = new EventSourcePolyfill (url, {
377
- headers: {
378
- ' Authorization' : ' Bearer ' + token,
379
- }
380
- });
376
+ const es = new EventSourcePolyfill (url, {
377
+ headers: {
378
+ ' Authorization' : ' Bearer ' + token,
379
+ }
380
+ });
381
381
382
382
In the following example controller,
383
383
the generated cookie contains a JWT, itself containing the appropriate targets.
@@ -545,7 +545,8 @@ its Mercure support.
545
545
Testing
546
546
--------
547
547
548
- During functional testing there is no need to send updates to Mercure. They will be handled by a stub publisher::
548
+ During functional testing there is no need to send updates to Mercure. They will
549
+ be handled by a stub publisher::
549
550
550
551
// tests/Functional/Fixtures/PublisherStub.php
551
552
namespace App\Tests\Functional\Fixtures;
@@ -560,13 +561,13 @@ During functional testing there is no need to send updates to Mercure. They will
560
561
}
561
562
}
562
563
563
- PublisherStub decorates the default publisher service so no updates are actually sent. Here is the PublisherStub implementation::
564
+ PublisherStub decorates the default publisher service so no updates are actually
565
+ sent. Here is the PublisherStub implementation::
564
566
565
- #services_test.yaml
567
+ # config/ services_test.yaml
566
568
App\Tests\Functional\Fixtures\PublisherStub:
567
569
decorates: mercure.hub.default.publisher
568
570
569
-
570
571
.. _`the Mercure protocol` : https://github.com/dunglas/mercure#protocol-specification
571
572
.. _`Server-Sent Events (SSE)` : https://developer.mozilla.org/docs/Server-sent_events
572
573
.. _`a polyfill` : https://github.com/Yaffle/EventSource
0 commit comments