The use of function getallheaders(), base64_decode(), rawurldecode() is discouraged. What are the alternative for these in Magento2

1 Answer 1


Probably you should use \Magento\Framework\Url\DecoderInterface::decode instead of base64_decode and rawurldecode (code source).

And for HTTP Headers Magento have class \Magento\Framework\HTTP\Header (code source).

  • Thanks for the help Leonid, I don't have enough reputation to upvote. Sep 24, 2021 at 4:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.