1

Context

I’m deploying a Proxy Auto-Config (PAC) file through JAMF MDM using the auto global HTTP proxy. The purpose of this file is to block some traffic on the network level. We’re deploying the PAC files on iPhones.

I tried to block all URLs ending with .pdf by using shExpMatch():

shExpMatch(url, “.*pdf”)

But iOS seems to just skip that line without implementing it. Am I doing something wrong or is there an apple specific function that I should use?

Here is my full code:

function FindProxyForURL(url, host)
{
    url = url.toLowerCase();
    host = host.toLowerCase();
    if (
       url.match(".pdf")
    || shExpMatch(url, ".*pdf")
    || _dnsDomainIs(host, "api.giphy.com")
    ) {
    // deny this request
    return blackhole;

    } else {
    return normal;
    }
}

Question

  • How can I block any link ending with ".pdf" using a PAC file on IOS?
MendelG
  • 14,885
  • 4
  • 25
  • 52
checkn8
  • 15
  • 3
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Nov 16 '22 at 16:13

0 Answers0