0

Preface:

We have written some software that allows our users to embed the content of many of their webpage building tools directly into their websites. For instance, our clients use a medley of Landing Page or "Funnel" building tools. Many of these tools are pretty antiquated and don't have a native way to bring that content elsewhere, and our clients don't like to send users to our-client.some-landing-page-builder.com/landing-page.

We have developed some software that will fetch the content at our-client.some-landing-page-builder.com/landing-page, do some work on the action, src, etc. attributes (some of these tools use relative URLs and wouldn't change them to absolute for us), and then it gets embedded directly into their website, our-client.com/landing-page/. It uses an optional cache or microcache to make sure that the content is fresh, and it has been working excellently for years.

The Problem:

When a user visits our-client.com/landing-page/, and the software makes a request to the content on the Landing Page builders, the request that is sent belong to the our-client.com and not the user that visited the site. For most of our clients, this isn't an issue.

The Question:

We have one client in particular that is asking if there's a way to send that user's request headers from our-client.com to some-landing-page-builder.com?

Xhynk
  • 13,513
  • 8
  • 32
  • 69
  • Do you mean to extract headers and store it somewhere, or you mean redirecting the request with original headers to a new location? For extracting headers you may use e.g. `getAllHeaders()` or most of crawler software should be able to extract headers - see e.g. https://stackoverflow.com/questions/9183178/can-php-curl-retrieve-response-headers-and-body-in-a-single-request . – lubosdz Jul 21 '20 at 18:05
  • I wasn't away of that, I'll take a look, thanks! But I suppose I mean something more along the lines of directly simulating a request from the user to a third party URI, without actually redirecting the user it. – Xhynk Jul 21 '20 at 18:12
  • Could you use PHP's `getallheaders()` or `apache_request_headers()`, encode the resulting array (e.g. into a JWT), and then pass that as an additional header e.g. `X-Original-Request-Headers` to the next service? – lufc Jul 21 '20 at 23:13

0 Answers0