470,851 Members | 1,119 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,851 developers. It's quick & easy.

mod_proxy_html and Apache 2.2.29: parse all <meta http-equiv="" content="">

I'm using Mamp 3 (pro) on Mac OS X Yosemite 10.10; I'v already compiled and installed mod_proxy_html (3.1.2) and mod_xml2enc, they are both correctly loaded by Apache 2.2.29 without issues.

This is my typical html file:

Expand|Select|Wrap|Line Numbers
  1.     <!DOCTYPE HTML>
  2.     <html>
  3.     <head>
  4.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5.         <meta http-equiv="Authorization" content="Bearer dummyToken">
  6.         <title>Header Test</title>
  7.     </head>
  8.     <body>
  10.     </body>
I need to convert all the <meta http-equiv="some" content="thing"> to real http headers. I've already known how to do this via ajax, it's not a problem. But I need to add an oauth token, inside the Authorization header field, to get access to various protected resources, like images or video streams, that are not served through ajax but referenced, through an url, directly inside the html.

So, directly inside my httpd.conf I have:

Expand|Select|Wrap|Line Numbers
  1.     ProxyHTMLEnable On
  2.     ProxyHTMLMeta On
this config should globally apply to apache. At the moment my server replies with all the field contained inside the request: it seems that the ProxyHTMLMeta On is ignored and all the meta tags are not translated into http headers:

Expand|Select|Wrap|Line Numbers
  1.     Accept: "*/*"
  2.     Accept-Encoding: "identity;q=1, *;q=0"
  3.     Accept-Language: "it,en;q=0.8"
  4.     Connection: "keep-alive"
  5.     Cookie: "laravel_session=dummy
  6.     DNT: "1"
  7.     Host: ""
  8.     Range: "bytes=0-"
  9.     User-Agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2535.0 Safari/537.36"
See, no Authorization header. If I call the api from SoapUI:

Expand|Select|Wrap|Line Numbers
  1.     "Accept-Encoding": "gzip,deflate",
  2.     "Authorization": "Bearer dummy",
  3.     "Host": "fillusso:8888",
  4.     "Connection": "Keep-Alive",
  5.     "User-Agent": "Apache-HttpClient/4.1.1 (java 1.5)"
It's a kind of magic, the header is there (because it directly sent from SoapUI, no parsing or meta tag here).

How can I solve the problem? Am I doing everything all right?
Oct 17 '15 #1
0 4783

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Terence | last post: by
1 post views Thread by Titus Cheung | last post: by
27 posts views Thread by Mxsmanic | last post: by
1 post views Thread by ptaz | last post: by
14 posts views Thread by Jim Carlock | last post: by
24 posts views Thread by Gary Hasler | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.