Questions tagged [http-header]
The http-header tag has no usage guidance.
17
questions
0
votes
0answers
11 views
How to prevent Host Header Poisoning in Magento 2?
I'm using magento 2.4.1 , i tried to make a GET request, i added ':22345' as suffix in my host header so it will look like this:
when I invoke this code in phtml file
echo $block->getRequest()->...
0
votes
0answers
6 views
Redirect header from API endpoint
I am trying to setup an API endpoint my mobile app can use to redirect to Google Play or Apple App Store depending on the device making the request. I have php code that was working stand alone and ...
1
vote
1answer
29 views
Cannot send headers; headers already sent When integrate third party API in magento 1.9
I am integrating third party API (wordpress) in magento on observer.
Integration working fine on my local system, but when I deploy it on server it give me error like below:
Cannot send headers; ...
1
vote
1answer
45 views
How set 404 HTTP response status from a block?
I'm trying to set 404 HTTP response status from a block's function.
With this code works
http_response_code(404);
exit;
but no way to to set the 404 status without exiting, i've found only ...
0
votes
0answers
56 views
Reload page after mass action on sales order grid
I created a new order status called Printed that has to be assigned after the mass action Print invoices on sales_order_grid.
I created all the custom logic to achieve the result. The only problem ...
2
votes
1answer
153 views
HOW TO ADD ALTERNATIVE HTTP HEADERS TO MAGENTO 2
I wanna add custom header to the response.
l do like this article
but it does not work. I guest it about Magento version. I use Magento 2.3
3
votes
3answers
425 views
set x-frame-options in custom controller magento2
I have a custom controller with below code.
namespace Vendor\Module\Controller\Service;
class Login extends \Magento\Framework\App\Action\Action{
protected $_storeManager;
protected $_customerFactory;...
1
vote
1answer
561 views
Error Showing in Console “X-XSS-Protection: 1; mode=block, 1; mode=block: expected semicolon” in Magento2
Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=block: expected semicolon at character position 13. The default protections will be applied.
I am using Apache Server.
How to resolve it. ...
1
vote
1answer
508 views
X-XSS-Protection header gets set twice - override XssProtection.php
I use magento 2 (version 2.3) and cloudFlare.
There is an error with http headers: X-XSS-Protection header gets set twice because magento add this and then ClouFlare add again.
See this post
It's ...
1
vote
1answer
52 views
How can I include additional headers in every 401 Magento2 response?
How can I include some additional headers every time server needs to send 401 responses?
I tried adding it in Magento\Framework\Controller\Result\Json render() method like:
if ($response->...
0
votes
1answer
748 views
Magento 2 Check if url returns 404
I have ann Array of urls
$arr = Array(
'http://magento2.com/url-exist',
'http://magento2.com/url-does-not-exist',
'http://magento2.com/url-does-not-exist',
'http://...
1
vote
1answer
2k views
Magento 2.2.5: Warning: Cannot modify header information - headers already sent by [custom_theme registration.php]
I'm developing a custom theme and running into errors. The theme has been tested and working on various servers but, for some reason, since uploading to siteground I get the following error (file ...
0
votes
1answer
2k views
how to set no-cache HTTP headers in controller in magento 2
I have read in Magento 2 Dev Docs for Public content we can set no-cache HTTP headers for Controllers that don’t use layouts(last line in page).
Controllers that don’t use layouts should set no-...
3
votes
1answer
6k views
Console showing Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=block:
I don't know what it's means and how to remove this error.
it's showing in my chrome console . but not in firefox console..
(index):1 Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=...
1
vote
0answers
121 views
Improve caching in Magento
I want to protect my site from DoS attacks and I want to change some http headers. At present I have the following headers:
Request URL:https://www.mysite.co.uk/
Request Method:GET
Status Code:200
...
4
votes
4answers
2k views
Magento2: How to modifiy http header of page?
I am trying to modify HTTP header for current URL. I want to set 410 status if current page header is 404.
below code I used but I have created new controller so it always set 410 for that controller ...
4
votes
3answers
5k views
Triggering a 404, 500, 503 error in Magento 2
Is there a standard way in Magento 2 to programmatically trigger an HTTP error state and have the system just deal with it? i.e. is there a standard exception we can throw or global method we can ...