Reply
tan
Contributor
Posts: 10
Registered: ‎04-03-2017

Library is not coming from Accept CDN.

Hey. A client has reached out to me with the following error message:

Please include Accept.js library from cdn.

And in the console:

Library is not coming from Accept CDN.

However the library is coming from the CDN. I have been unable to reproduce the error without actually loading it from somewhere else. The client has already tried clearing the browser cache. What else could be causing this issue?

 

Thank you.

Posts: 2,765
Topics: 57
Kudos: 245
Blog Posts: 67
Registered: ‎12-05-2011

Re: Library is not coming from Accept CDN.

@tan

 

Could you share your code so we can see how you're calling Accept.js?

 

Richard

tan
Contributor
Posts: 10
Registered: ‎04-03-2017

Re: Library is not coming from Accept CDN.

 

Here it is.

<script type='text/javascript' src='https://js.authorize.net/v1/Accept.js'></script>

It works for me. I tested it in 3 different browsers.

 

Posts: 2,765
Topics: 57
Kudos: 245
Blog Posts: 67
Registered: ‎12-05-2011

Re: Library is not coming from Accept CDN.

Try adding the character set command and see if that helps.

 

  <script type="text/javascript" src="https://js.authorize.net/v1/Accept.js" charset="utf-8"></script>

 

Richard

tan
Contributor
Posts: 10
Registered: ‎04-03-2017

Re: Library is not coming from Accept CDN.

Would the following tag have the same effect?

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

I have that at the top of the page. The recommended way to add scripts on the platform we're using does not give us the ability to add any attributes to the script tag itself. If this was the problem, would it not cause the same error for everyone? I have had no such errors on my end and I have tested it in Chrome, Firefox, and Edge. Also, some Googling tells me that a missing charset would result in a different error. Thanks.

All Star
Posts: 699
Registered: ‎11-03-2016

Re: Library is not coming from Accept CDN.

Hi @tan,

 

The script itself is doing some integrity checking to see if it's intact and served from the right place. If a browser loads the script but interprets it with a different encoding, those checks could fail on that browser.

 

Can you test your site on your end, but change your browser's encoding to a different charset and see if you can duplicate the error?

tan
Contributor
Posts: 10
Registered: ‎04-03-2017

Re: Library is not coming from Accept CDN.

Hey @Aaron. Thanks for your help. I tried using a few different character encodings but I was unable to reproduce the error. What other checks could be failing?

Contributor
Posts: 19
Registered: ‎12-08-2016

Re: Library is not coming from Accept CDN.

Trying to debug a third-party's browser is quite difficult!

 

I imagine it could also be other factors such as plugins. Have you had the client try an incognito chrome, or private browsing firefox mode?

tan
Contributor
Posts: 10
Registered: ‎04-03-2017

Re: Library is not coming from Accept CDN.

Yeah, they tried private browsing in Chrome and Firefox.

All Star
Posts: 699
Registered: ‎11-03-2016

Re: Library is not coming from Accept CDN.


@tan wrote:

Hey @Aaron. Thanks for your help. I tried using a few different character encodings but I was unable to reproduce the error. What other checks could be failing?


The main check is just the source of the script. Accept.js script calls another script on our site (AcceptCore.js) which is basically checking the source URL of the first script. If that URL doesn't match https://js.authorize.net/v1/Accept.js, it throws the error.

 

If that customer's browser is seeing that the script has a different source, I might start to be concerned about some really aggressive cache upstream that somehow is serving redirects instead of content, or possibly some malware on the customer's end. I'm trying to think of other ways this could fail and am coming up blank.