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

"Telegram Bot PHP SDK v3.0.0 - (https://github.com/irazasyed/telegram-bot-sdk)" is not valid header value #933

Closed
andrey-helldar opened this issue Mar 20, 2022 · 1 comment

Comments

@andrey-helldar
Copy link
Contributor

andrey-helldar commented Mar 20, 2022

  • Telegram Bot: v3.5
  • Laravel Framework: 9.5.1
  • guzzlehttp/http: 7.4.1
  • guzzlehttp/psr7: 2.2.0 (2.1.0 - no errors)
  • PHP: 8.1.4
{
    "error": {
        "type": "InvalidArgumentException",
        "data": "\"Telegram Bot PHP SDK v3.0.0 - (https:\/\/github.com\/irazasyed\/telegram-bot-sdk)\" is not valid header value"
    }
}
Stack Trace
[2022-03-20 14:20:43] local.ERROR: "Telegram Bot PHP SDK v3.0.0 - (https://github.com/irazasyed/telegram-bot-sdk)" is not valid header value {"exception":"[object] (InvalidArgumentException(code: 0): \"Telegram Bot PHP SDK v3.0.0 - (https://github.com/irazasyed/telegram-bot-sdk)\" is not valid header value at D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\guzzlehttp\\psr7\\src\\MessageTrait.php:263)
[stacktrace]
#0 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\guzzlehttp\\psr7\\src\\MessageTrait.php(209): GuzzleHttp\\Psr7\\Request->assertValue('Telegram Bot PH...')
#1 [internal function]: GuzzleHttp\\Psr7\\Request->GuzzleHttp\\Psr7\\{closure}('Telegram Bot PH...')
#2 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\guzzlehttp\\psr7\\src\\MessageTrait.php(212): array_map(Object(Closure), Array)
#3 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\guzzlehttp\\psr7\\src\\MessageTrait.php(174): GuzzleHttp\\Psr7\\Request->trimAndValidateHeaderValues(Array)
#4 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\guzzlehttp\\psr7\\src\\MessageTrait.php(154): GuzzleHttp\\Psr7\\Request->normalizeHeaderValue('Telegram Bot PH...')
#5 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\guzzlehttp\\psr7\\src\\Request.php(49): GuzzleHttp\\Psr7\\Request->setHeaders(Array)
#6 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\guzzlehttp\\guzzle\\src\\Client.php(164): GuzzleHttp\\Psr7\\Request->__construct('POST', Object(GuzzleHttp\\Psr7\\Uri), Array, NULL, '1.1')
#7 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\irazasyed\\telegram-bot-sdk\\src\\HttpClients\\GuzzleHttpClient.php(82): GuzzleHttp\\Client->requestAsync('POST', Object(GuzzleHttp\\Psr7\\Uri), Array)
#8 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\irazasyed\\telegram-bot-sdk\\src\\TelegramClient.php(75): Telegram\\Bot\\HttpClients\\GuzzleHttpClient->send('https://api.tel...', 'POST', Array, Array, false)
#9 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\irazasyed\\telegram-bot-sdk\\src\\Traits\\Http.php(305): Telegram\\Bot\\TelegramClient->sendRequest(Object(Telegram\\Bot\\TelegramRequest))
#10 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\irazasyed\\telegram-bot-sdk\\src\\Traits\\Http.php(198): Telegram\\Bot\\Api->sendRequest('POST', 'deleteMessage', Array)
#11 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\irazasyed\\telegram-bot-sdk\\src\\Methods\\EditMessage.php(231): Telegram\\Bot\\Api->post('deleteMessage', Array)
#12 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Services\\Telegram\\Message.php(32): Telegram\\Bot\\Api->deleteMessage(Array)
#13 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Jobs\\Telegram\\Messages\\DeleteJob.php(34): App\\Services\\Telegram\\Message->delete(726814)
#14 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Jobs\\Telegram\\Messages\\BaseJob.php(59): App\\Jobs\\Telegram\\Messages\\DeleteJob->process()
#15 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Helpers\\Requests\\Http.php(15): App\\Jobs\\Telegram\\Messages\\BaseJob->App\\Jobs\\Telegram\\Messages\\{closure}()
#16 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Support\\Facades\\Facade.php(337): App\\Helpers\\Requests\\Http->request(Array, Object(Closure))
#17 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Jobs\\Telegram\\Messages\\BaseJob.php(59): Illuminate\\Support\\Facades\\Facade::__callStatic('request', Array)
#18 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(36): App\\Jobs\\Telegram\\Messages\\BaseJob->handle()
#19 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#20 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#21 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(DragonCode\\LaravelRouteNames\\Application), Array, Object(Closure))
#22 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(653): Illuminate\\Container\\BoundMethod::call(Object(DragonCode\\LaravelRouteNames\\Application), Array, Array, NULL)
#23 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php(128): Illuminate\\Container\\Container->call(Array)
#24 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#25 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#26 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#27 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\CallQueuedHandler.php(119): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(App\\Jobs\\Telegram\\Messages\\DeleteJob), false)
#28 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}(Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#29 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#30 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\CallQueuedHandler.php(121): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#31 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\CallQueuedHandler.php(69): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\\Queue\\Jobs\\SyncJob), Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#32 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Jobs\\Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call(Object(Illuminate\\Queue\\Jobs\\SyncJob), Array)
#33 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\SyncQueue.php(43): Illuminate\\Queue\\Jobs\\Job->fire()
#34 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Queue.php(57): Illuminate\\Queue\\SyncQueue->push(Object(App\\Jobs\\Telegram\\Messages\\DeleteJob), '', 'high')
#35 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php(246): Illuminate\\Queue\\Queue->pushOn('high', Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#36 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php(229): Illuminate\\Bus\\Dispatcher->pushCommandToQueue(Object(Illuminate\\Queue\\SyncQueue), Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#37 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php(77): Illuminate\\Bus\\Dispatcher->dispatchToQueue(Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#38 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bus\\PendingDispatch.php(193): Illuminate\\Bus\\Dispatcher->dispatch(Object(App\\Jobs\\Telegram\\Messages\\DeleteJob))
#39 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bus\\Dispatchable.php(17): Illuminate\\Foundation\\Bus\\PendingDispatch->__destruct()
#40 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Concerns\\TelegramJobs.php(32): App\\Jobs\\Telegram\\Messages\\BaseJob::dispatch(Object(App\\Enums\\Telegram\\BotName), -1001712003365, 726814, false)
#41 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Processors\\Telegram\\BaseProcessor.php(45): App\\Processors\\Telegram\\BaseProcessor->deleteMessage(Object(App\\Enums\\Telegram\\BotName), -1001712003365, 726814, false)
#42 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Processors\\Telegram\\Messages\\Voice.php(14): App\\Processors\\Telegram\\BaseProcessor->delete(726814, false)
#43 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Bots\\Telegram\\Bots\\BaseBot.php(43): App\\Processors\\Telegram\\Messages\\Voice->handle()
#44 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Bots\\Telegram\\Bots\\CleanerBot.php(41): App\\Bots\\Telegram\\Bots\\BaseBot->processor('App\\\\Processors\\\\...')
#45 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Bots\\Telegram\\Manager.php(30): App\\Bots\\Telegram\\Bots\\CleanerBot->handle()
#46 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Http\\Controllers\\Telegram\\BotController.php(22): App\\Bots\\Telegram\\Manager->handle()
#47 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php(54): App\\Http\\Controllers\\Telegram\\BotController->__invoke(Object(App\\Http\\Requests\\Telegram\\UpdateRequest), Object(App\\Models\\Telegram\\TelegramBot))
#48 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('__invoke', Array)
#49 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php(261): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(DragonCode\\LaravelRouteNames\\Routing\\Route), Object(App\\Http\\Controllers\\Telegram\\BotController), '__invoke')
#50 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php(204): Illuminate\\Routing\\Route->runController()
#51 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(725): Illuminate\\Routing\\Route->run()
#52 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#53 D:\\domains\\dragon-code\\apps\\webhooks\\app\\Http\\Middleware\\Telegram\\TelegramLocaleMiddleware.php(20): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#54 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): App\\Http\\Middleware\\Telegram\\TelegramLocaleMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#55 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#56 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#57 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\dragon-code\\laravel-http-logger\\src\\Http\\Middleware\\HttpLogMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#58 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): DragonCode\\LaravelHttpLogger\\Http\\Middleware\\HttpLogMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#59 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#60 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(727): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#61 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(702): Illuminate\\Routing\\Router->runRouteWithinStack(Object(DragonCode\\LaravelRouteNames\\Routing\\Route), Object(Illuminate\\Http\\Request))
#62 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(666): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(DragonCode\\LaravelRouteNames\\Routing\\Route))
#63 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(655): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#64 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(167): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#65 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#66 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#67 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#68 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#69 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#70 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#71 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#72 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#73 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#74 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#75 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#76 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Middleware\\HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#77 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#78 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Middleware\\TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#79 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#80 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\dragon-code\\laravel-json-response\\src\\Middlewares\\SetHeaderMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#81 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): DragonCode\\LaravelJsonResponse\\Middlewares\\SetHeaderMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#82 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#83 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#84 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#85 D:\\domains\\dragon-code\\apps\\webhooks\\public\\index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#86 D:\\domains\\dragon-code\\apps\\webhooks\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\
esources\\server.php(16): require_once('D:\\\\domains\\\\drag...')
#87 {main}
"} 

Tests:

Doesn't work:

public function getDefaultHeaders(): array
{
    return [
        'User-Agent' => 'Telegram Bot PHP SDK v'.Api::VERSION.' - (https://github.com/irazasyed/telegram-bot-sdk)',
    ];
}

Works:

public function getDefaultHeaders(): array
{
    return [
        // 'User-Agent' => 'Telegram Bot PHP SDK v'.Api::VERSION.' - (https://github.com/irazasyed/telegram-bot-sdk)',
    ];
}

Works:

public function getDefaultHeaders(): array
{
    return [
        'User-Agent' => 'Irazasyed Telegram Bot PHP SDK v'.Api::VERSION,
    ];
}

Guzzle Http

https://github.com/guzzle/psr7/blob/master/src/MessageTrait.php

private function assertValue(string $value): void
{
    // The regular expression intentionally does not support the obs-fold production, because as
    // per RFC 7230#3.2.4:
    //
    // A sender MUST NOT generate a message that includes
    // line folding (i.e., that has any field-value that contains a match to
    // the obs-fold rule) unless the message is intended for packaging
    // within the message/http media type.
    //
    // Clients must not send a request with line folding and a server sending folded headers is
    // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting
    // folding is not likely to break any legitimate use case.
    if (! preg_match('/^(?:[\x21-\x7E\x80-\xFF](?:[\x20\x09]+[\x21-\x7E\x80-\xFF])?)*$/', $value)) {
        throw new \InvalidArgumentException(sprintf('"%s" is not valid header value', $value));
    }
}

image

@andrey-helldar
Copy link
Contributor Author

In version 2.2.1, the regular expression has been fixed. Now everything is correctly defined.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants