This Fixes CORS

Поделиться
HTML-код
  • Опубликовано: 15 янв 2025

Комментарии • 24

  • @colbyfayock
    @colbyfayock  5 месяцев назад

    Learn how to build a full stack Next.js app in my upcoming course: colbyfayock.com/course

  • @AndrewJot-z9l
    @AndrewJot-z9l 2 месяца назад +1

    By far the best video that really explains CORS and how to overcome it!

  • @LeHarT99
    @LeHarT99 7 месяцев назад +4

    Bro you just saved me, THANK YOU!. Suscribed and liked this video

    • @colbyfayock
      @colbyfayock  7 месяцев назад +1

      happy to hear that! 🙌 and thanks for the sub 😁

  • @bandekhoda7801
    @bandekhoda7801 6 месяцев назад +1

    Wait a minute isn't this a huge security issue in the browsers, that I can easily fetch from a website I just opened up and have that website URL as my origin? Does the IP also point to that website I'm fetching from (in the console) or is it my IP? Is the website allowed to not let people fetch using it's origin?

    • @colbyfayock
      @colbyfayock  6 месяцев назад

      i dont know that i completely follow your question, but:
      - yes you can theoretically go to your browser's console and create a same-site origin request to the website you're on
      - there are extra security guards that you can place, that larger websites often place, to prevent someone from abusing that, such as authentication, rate limiting, DDOS prevention, etc
      - im not sure what you mean by the IP question
      - by default, without CORS headers, you can not fetch from a website from another origin, this video shows how to do that in a way that you're not allowing ALL websites to make those requests, but only the ones that you choose

  • @nemeziz_prime
    @nemeziz_prime 7 месяцев назад +1

    Amazing video as usual! Keep going 💪🏻

  • @LearnAlongFaizan
    @LearnAlongFaizan 6 месяцев назад +1

    Great video,
    Please make complete tutorial on authjs v5, rolebased, customer cookie, client side validations

    • @colbyfayock
      @colbyfayock  6 месяцев назад +1

      thanks for the idea!

    • @LearnAlongFaizan
      @LearnAlongFaizan 6 месяцев назад

      @@colbyfayock I hope so you've started making the video, because I've turned on your notification.

  • @notrab
    @notrab 7 месяцев назад

    Nice video @colbyfayock! Another workaround I've been trying lately (but need to measure bandwidth usage) is by adding a `rewrites` option to my Next.js config. The source would be the path I want to post to (could be your API), then the destination the original.
    I've been using it for file uploads, so this could get expensive $$$$

    • @colbyfayock
      @colbyfayock  7 месяцев назад

      ohhh thats interesting! i never thought about rewrites from a billing perspective, is that measured in bandwidth?

  • @nitinmungilwar659
    @nitinmungilwar659 7 месяцев назад

    Great Colby 👍

  • @kenshinhimura3140
    @kenshinhimura3140 7 месяцев назад

    He became my friend now

  • @alvingultiano519
    @alvingultiano519 5 месяцев назад

    damn this one is really something :D

  • @v1d300
    @v1d300 7 месяцев назад

    So I never needed the cors npm package?

    • @colbyfayock
      @colbyfayock  7 месяцев назад +1

      this is my first time seeing the cors package, but it looks like it's still a great and easy way to configure CORS specifically in an Express app, where im not sure that this would work inside of a serverless function? but if you wanted to avoid using CORS, you could use this technique to configure the headers yourself, which is partially what the package does

  • @colbyfayock
    @colbyfayock  7 месяцев назад

    Get fresh tutorials and other free content straight to your inbox! colbyfayock.com/news

    • @colbyfayock
      @colbyfayock  7 месяцев назад

      @CricMaster-oo6uf hey thanks for the idea, will keep it in mind!