Resource icon

Custom HTTP Client headers 1.0.0 Alpha

No permission to download

Kruzya

Well-known member
Kruzya submitted a new resource:

Custom HTTP Client headers - Allows set additional HTTP headers via 'src/config.php'

This simple add-on just allows add/set custom headers to all HTTP requests from XenForo via src/config.php. For example, you may want set Accept-Language for using another language, if remote web-resource respects this header.

Example usage (src/config.php):
PHP:
<?php

// database options ...
// additional options for caching (for example), proxying all HTTP requests and another...

$config['http']['headers'] = [
    // Prefers russian...

Read more about this resource...
 

Mave

Active member
@Kruzya Installed addon and added the following to src/config.php:

Code:
$config['http']['headers'] = [
    'Accept-Language' => 'en-US,en;q=0.9, *:q=0.5'
];

However, links are still displayed in German.
Example: https://forums.tms.sx/threads/movies-general-discussion.24954/page-20#post-362015

BYZlsHb.png
 

Mave

Active member
@Kruzya SOLVED by using:

Code:
$config['http']['headers'] = [
    'Accept-Language' => 'en-us, en-gb;q=0.8, en;q=0.7'
];
 
Top