JSON quote feed: allow custom HTTP headers (patch attached)

Hello,

Since the end of May 2026, Boursorama’s GetTicksEOD endpoint answers “410 Gone” unless the request carries the header X-Requested-With: XMLHttpRequest. Many French users relied on this endpoint through the JSON quote provider (see Securities price update not working since May 29), and there is currently no way to add a header in Portfolio Performance. As a workaround I run a small local relay that adds the header, but that is not something most users can set up.

Custom headers have also been asked for authenticated JSON feeds (bearer token, API key): Support for authentication when using custom JSON quote feed

I prepared a patch that adds an optional “HTTP headers” field to the JSON provider, for both historical and latest quotes:

  • One header per line, in the form Name: Value. Blank or malformed lines are ignored.
  • A User-Agent or Accept header given there replaces the default one.
  • Stored as new feed properties GENERIC-JSON-HEADERS and GENERIC-JSON-HEADERS-LATEST.
  • Without configured headers, the behaviour is unchanged.
  • Unit tests added in GenericJSONQuoteFeedTest (header parsing and headers passed to the request). The existing mocks are updated to the new getJson(url, headers) signature.
  • The two new labels are added to all messages*.properties files (English text as a placeholder for the translators).

Example for Boursorama:

Field Value
Feed URL https://www.boursorama.com/bourse/action/graph/ws/GetTicksEOD?symbol=1rTCW8&length=7300&period=0
Path to date $.d.QuoteTab[*].d
Path to close $.d.QuoteTab[*].c
HTTP headers X-Requested-With: XMLHttpRequest

I checked with curl, using the User-Agent and Accept headers Portfolio Performance already sends. With the header:

curl -s -o /dev/null -w "%{http_code}\n" -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Safari/605.1.15" -H "Accept: application/json" -H "X-Requested-With: XMLHttpRequest" "https://www.boursorama.com/bourse/action/graph/ws/GetTicksEOD?symbol=1rTCW8&length=30&period=0"
200

Without it:

curl -s -o /dev/null -w "%{http_code}\n" -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Safari/605.1.15" -H "Accept: application/json" "https://www.boursorama.com/bourse/action/graph/ws/GetTicksEOD?symbol=1rTCW8&length=30&period=0"
410

Full disclosure: the patch was written by Claude (Anthropic’s AI assistant) at my request; the commit carries a “Co-Authored-By: Claude” line. I am not a Java developer, so I could not build and test it on my side, and it deserves a careful review. The attached file is a git format-patch against the current master, so it can be applied with git am. Any feedback is welcome, and if you prefer a pull request on GitHub, just tell me and I will open one.

Thank you for Portfolio Performance!
Pierre
pp-json-feed-http-headers.patch.txt (52,9 Ko)