@@ -136,7 +136,6 @@ public function newEvent(GSEvent $event): string {
136136
137137 try {
138138 $ gs = $ this ->globalScaleService ->getGlobalScaleEvent ($ event );
139-
140139 if ($ this ->isLocalEvent ($ event )) {
141140 $ gs ->verify ($ event , true );
142141 if (!$ event ->isAsync ()) {
@@ -196,16 +195,21 @@ public function broadcastWrapper(GSWrapper $wrapper, string $protocol): void {
196195 public function broadcastEvent (GSEvent $ event , string $ instance , string $ protocol = '' ): void {
197196 $ this ->signEvent ($ event );
198197
199- $ path = $ this ->urlGenerator ->linkToRoute ('circles.GlobalScale.broadcast ' );
200- $ request = new NC19Request ($ path , Request::TYPE_POST );
201- $ this ->configService ->configureRequest ($ request );
202- $ protocols = ['https ' , 'http ' ];
203- if ($ protocol !== '' ) {
204- $ protocols = [$ protocol ];
198+ if ($ this ->configService ->isLocalInstance ($ instance )) {
199+ $ request = new NC19Request ('' , Request::TYPE_POST );
200+ $ this ->configService ->configureRequest ($ request , 'circles.GlobalScale.broadcast ' );
201+ } else {
202+ $ path = $ this ->urlGenerator ->linkToRoute ('circles.GlobalScale.broadcast ' );
203+ $ request = new NC19Request ($ path , Request::TYPE_POST );
204+ $ this ->configService ->configureRequest ($ request );
205+ $ protocols = ['https ' , 'http ' ];
206+ if ($ protocol !== '' ) {
207+ $ protocols = [$ protocol ];
208+ }
209+ $ request ->setInstance ($ instance );
210+ $ request ->setProtocols ($ protocols );
205211 }
206212
207- $ request ->setHost ($ instance );
208- $ request ->setProtocols ($ protocols );
209213 $ request ->setDataSerialize ($ event );
210214
211215 $ data = $ this ->retrieveJson ($ request );
0 commit comments