Coder Social home page Coder Social logo

Comments (9)

javivelasco avatar javivelasco commented on April 30, 2024 2

Hi! Can you test now? It should be fine πŸ™

from edge-runtime.

Kikobeats avatar Kikobeats commented on April 30, 2024 1

Hello @brycewray, sorry for the delay, and thanks for attaching all these details, it's really appreciated.

I don't think it's an Edge Runtime issue, but still a Vercel infrastructure issue, so I'm going to reproduce and try to understand why it's happening, let me keep you in touch πŸ™‚

from edge-runtime.

Kikobeats avatar Kikobeats commented on April 30, 2024 1

We disabled the email obfuscation that should never have been enabled and the issue it's gone, so thanks a lot for reporting this

from edge-runtime.

brycewray avatar brycewray commented on April 30, 2024

Apparently not of interest beyond me. Disregard. Site is now off Vercel, so the static-site-omega.vercel.app project is back to being only a holder.

Edit: Ironically enough, the oddity doesn’t appear on the new/previous location, Cloudflare Pages, since I have this feature turned off β€” as, indeed, I did while the site was on Vercel but DNS was going through Cloudflare. Weird.

from edge-runtime.

brycewray avatar brycewray commented on April 30, 2024

Re-opening this because I would still appreciate an answer. :) If I need to rebuild the static-site-omega.vercel.app project to its previous state (as mentioned above) so anyone at Vercel can take a run at this, let me know.

from edge-runtime.

brycewray avatar brycewray commented on April 30, 2024

@Kikobeats Thanks! I am currently running some tests of my own, switching out some items in middleware.js to see whether I can find the offending item. πŸ˜ƒ If I find it, I'll advise here.

from edge-runtime.

brycewray avatar brycewray commented on April 30, 2024

@Kikobeats It appears to be related to the following part of my middleware.js file, where I use replace to add generated nonces to the HTML for the Content Security Policy; if I comment this out, the bogus script doesn’t appear:

const html = (await response.text())
  .replace(/DhcnhD3khTMePgXw/gi, nonce)
    .replace(
      'rel="stylesheet"',
      `rel="stylesheet" nonce="${nonce}"`
    )
    .replace(/<link rel="preload"/g, `<link nonce="${nonce}" rel="preload"`)
    .replace(
      'guitar-thriving.brycewray.com/script.js"',
      `guitar-thriving.brycewray.com/script.js" nonce="${nonce}"`
    )
    .replace(
      'src="/assets/js/lite-yt-embed_',
      `nonce="${nonce}" src="/assets/js/lite-yt-embed_`
    )
    .replace(/<style/g, `<style nonce="${nonce}"`)

I also tried commenting out each separate replace statement to see if one of them was the cause, and it made no difference; only commenting out all of the code shown above would remove the bogus script.

Also: I was able to recreate the same issue on another repo by using the middleware.js file (with replace statements intact) and adding text that triggered the bogus script on one of the first repo’s pages:

https://hosts-test.vercel.app/posts/2022/05/another-test-4/

. . . so this pretty well confirms that, somehow, the replace statements are causing this.

from edge-runtime.

brycewray avatar brycewray commented on April 30, 2024

Hello @brycewray, sorry for the delay, and thanks for attaching all these details, it's really appreciated.

I don't think it's an Edge Runtime issue, but still a Vercel infrastructure issue, so I'm going to reproduce and try to understand why it's happening, let me keep you in touch πŸ™‚

@Kikobeats Any luck yet? During my tests, I found one page where, if someone has JS deactivated, this oddity actually changes a Mastodon link to some error message about email obfuscation πŸ˜† β€” so, needless to say, I can’t use Vercel for my site until/unless this is fixed. Thanks again for whatever time you have to spend on this.

from edge-runtime.

brycewray avatar brycewray commented on April 30, 2024

Hi! Can you test now? It should be fine πŸ™

@javivelasco Yes, appears to be fixed. Checked several of the β€œtrouble” pages and saw no bogus script. πŸ‘ What turned out to be the problem?

from edge-runtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.