Questions tagged [symfony-http-foundation]

Symfony is a set of reusable PHP components. The HttpFoundation component defines an object-oriented layer for the HTTP specification.

Symfony is a set of reusable PHP components. The HttpFoundation component defines an object-oriented layer for the HTTP specification.

Useful links

61 questions
1
vote
0 answers

Symfony HttpFoundation\Request with no user agent specified leads to 403 Forbidden

I am using symfony to create an API to update some dataset. One of the possible update is coming from a third party through an HTTP request which does not include user agent specifications. As a result, the call is returning a 403 Forbidden error. I…
1
vote
1 answer

How to serve same response from HttpClient in my controller using Symfony?

I have a Controller that must forward the received request (changing some query parameters) to another server, and returns it's response (with same headers, status and body). I decided to use HttpClient for doing that. The problem is that HttpClient…
1
vote
1 answer

Symfony routing allows commas where dots are configurated

I have a route configuration: SpecialControllerBundle:Default:index 1.1|1.2|1.3
EdvinasPocius
  • 173
  • 2
  • 10
1
vote
0 answers

Why is Symfony's UploadedFile `getClientOriginalName()` considered unsafe?

The docs only state that it's user-provided input and therefore not to be trusted. That much makes sense since we never trust user input, but in what ways could a malicious user cause damage with this or the other request parameters on an uploaded…
Michael Cordingley
  • 1,485
  • 1
  • 11
  • 23
1
vote
1 answer

Get both fields from url and convert them to variables to query a search

I am trying to get both fields in an api enpoint so that it queries based on that. example. api/evenSession/123123123/eventSession?token=1234656&filter= chris moreno my controller searches by first or last name. But i want to create an endpoint…
user7401552
1
vote
1 answer

How does the Symfony/Http-foundation component handles Http request and response

I've been assigned to a project which needs include the Symfony components in order to re-organize its business logic. However, I got confused by looking at the Symfony HTTP-foundation document. Hope someone here could help me explain a bit how this…
Hazel Wang
  • 111
  • 1
  • 10
1
vote
1 answer

How to Set and Read a Cookie w/ http-foundation, JWT, & .ENV

I have a login processing file in which I am attempting to set a cookie: $expTime = time() + 3600; $key = getenv("SECRET_KEY"); $token = array( "iss" => request()->getBaseUrl(), "sub" => [$user['id']], "exp" => $expTime, …
1
vote
1 answer

BinaryFileResponse not working correctly in Firefox - Image corrupt or truncated

I'm facing some weird issues when Firefox tries to load PHP generated image files. Occurs on Mac and Windows (7, 8, 10). The Firefox console says: Image corrupt or truncated. Everything works fine in Chrome, Safari and IE/Edge. But it's not an…
user4521733
1
vote
1 answer

Get file extension after file is uploaded and moved in Symfony2

I'm uploading a file through Symfony2 and I am trying to rename original in order to avoid override the same file. This is what I am doing: $uploadedFile = $request->files; $uploadPath = $this->container->getParameter('kernel.root_dir') .…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
1
vote
0 answers

Symfony2 : Save image form field in session

I want to save the form data in session in case of an error occured then I can display valid form data in my form view. I've got a file field for an image but I've got this error when I submit my form with an image : Serialization of…
Antoine Subit
  • 9,803
  • 4
  • 36
  • 52
0
votes
0 answers

How to pass session using HTTP Foundation from Controller Class into Chat Class in Ratchet Websocket?

I want to pass the session into the Chat class so I can use the user_id as the reference of the user who sent a message. I tried everything but I still had the session value empty. Server.php ( Ratchet Server)
0
votes
0 answers

How to install symfony's http foundation in Joomla4 and autload all classes?

After upgrading to Joomla4.3 from Joomla 3.10.11, I am getting typo3 PharStreamWrapper uncaught exception: Fatal error: Uncaught TYPO3\PharStreamWrapper\Exception: Unexpected file extension in…
0
votes
1 answer

PHP Symfony session variables automatically updated

I'm using the Concrete CMS which leverages the Symfony-HTTP-foundation component for Session management. I have everything working, but I'm curious about some strange behavior I'm seeing. Take this example: if (!is_null($session)) { if…
0
votes
1 answer

Retrieve symfony parameters of RedirectResponse

I use the stand alone HttpFoundation component of Symfony in my MVC app, and native PHP files for the view templates (not Twig). The functions in the controller can successfully execute a URL redirection to the template path as follows: return new…
blsn
  • 1,077
  • 3
  • 18
  • 38
0
votes
0 answers

Argument 1 passed to Symfony\Component\HttpFoundation\InputBag::get() must be of the type string, null given

Argument 1 passed to Symfony\Component\HttpFoundation\InputBag::get() must be of the type string, null given, called in D:\Syed Ghazanfar\Futafut\Backend\v2\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php on line 157 I…