Cross Origin Resource Sharing (Explained by Example)

Поділитися
Вставка
  • Опубліковано 3 жов 2024

КОМЕНТАРІ • 386

  • @hnasr
    @hnasr  5 років тому +52

    Jump codes for your convenient
    03:00 Direct same origin access
    04:00 CORS Policy Error #1 - No 'Access-Control-Allow-Origin' header is present
    08:10 CORS Policy Error #2 - The ‘Access-Control-Allow-Origin' header has a different value from the origin
    10:10 CORS Policy Error #3 - OPTIONS 405 Method not Allowed (Preflight failed)
    17:00 CORS Policy Error #4 - Response to preflight request did not pass No 'Access-Control-Allow-Origin' header is present
    19:00 CORS Policy Error #5 - Request header field “Content-Type” is not allowed

    • @aminomar7890
      @aminomar7890 3 роки тому

      I had the same problem, searched the web, they talk too much but making it more complicated than it is ! such a people usually don not understand good, because who understand can make it easier to digest not harder! "talk too much but useless!"!
      you made it easy as it is ! many thanks..

    • @aminomar7890
      @aminomar7890 3 роки тому

      the Web is full of those showing on but has nothing "wasting their time and others time with their nonsense!", many thanks again for for keeping it easy as it is instead of their nonsense..

    • @pratikgiri878
      @pratikgiri878 2 роки тому

      How can I configure cors to only accept content-type : application/json ?

  • @LetsBuildThatApp
    @LetsBuildThatApp 3 роки тому +99

    We need professors like you in our universities, enthusiastic and full of energy.

  • @FadiYoosuf
    @FadiYoosuf Рік тому +4

    Watching this in 2022. You had only 3215 subscribers 4 years ago. This is really an inspiration

  • @yumengsi
    @yumengsi 5 років тому +78

    Finally someone can explain these things clearly, thank you!

    • @hnasr
      @hnasr  5 років тому +3

      Yumeng Si really happy i could help!

  • @dawid_dahl
    @dawid_dahl 4 роки тому +18

    This is my new favourite programming channel on UA-cam. Finally someone who actually knows what they're talking about, and takes time to explain what's going on from first principles.

  • @Malkit_123
    @Malkit_123 5 років тому +81

    Very good explanation. Best tutorial i have ever seen. Great work.

    • @hnasr
      @hnasr  5 років тому +3

      Malkit Jatt thank you so much for watching. Glad you enjoyed the tutorial:)

    • @FordExplorer-rm6ew
      @FordExplorer-rm6ew 4 роки тому +2

      @@hnasr dude, you have like every concept I ever need to know. You rock

    • @hnasr
      @hnasr  4 роки тому +2

      E girl Respecter 😊 enjoy the content!

  • @rezamanshouri9773
    @rezamanshouri9773 5 років тому +58

    Duuude, this was the most enjoyable tutorial I've watched in a while, great job!

    • @hnasr
      @hnasr  5 років тому +4

      Awesome! Glad you liked the video and thanks for your comment Reza!

  • @akashasthana6742
    @akashasthana6742 4 роки тому +4

    Hussein you're doing an awesome job explaining concepts that no one else cares explaining. Thank you.

  • @nikhilraj4098
    @nikhilraj4098 6 місяців тому +2

    Oh man! I just loved the way you explained CORS!
    Never stop teaching and more importantly keep the same fun and energy! ❤

  • @davidkennell3967
    @davidkennell3967 3 місяці тому

    This is absolute gold, man. You have a great intuition for knowing which web development fundamentals are under-taught, and for covering them very well. Thanks for this.

  • @tomr6818
    @tomr6818 3 роки тому +2

    CORS has been confusing me for so long, but after your deep dive, I actually understand what's going on when I get these errors. Thank you so much!!

  • @BunnyOfThunder
    @BunnyOfThunder 4 роки тому +2

    I was not merely informed, I was entertained. Walking through the whole process, both response and request, was very useful.

  • @akrylic_
    @akrylic_ 4 роки тому +15

    Love the charisma, I can tell that you genuinely care about making sure we understand, great job!

    • @hnasr
      @hnasr  4 роки тому +5

      Akrylic thanks 🙏 that is true I deeply care about my craft and making the best content for you guys. I also strive to get better at it so let me know how can I do better or if there is any new topic you want me to cover.
      Cheers
      Hussein

  • @lukechen3794
    @lukechen3794 5 років тому +9

    I am saving this video. Literally couldn't figure out why I couldn't access my site between using localhost and the actual ip. Thanks again!

  • @unknownad_official
    @unknownad_official 4 роки тому +3

    unique subject i think you are the only one who explained it

  • @adityasethi9794
    @adityasethi9794 3 роки тому

    this guy is a genius. the way you explain as a story just shows how well u understand stuff

  • @ttt1986
    @ttt1986 2 роки тому

    I referred many articles on this.. but nothing could give me the clearest idea like you did right here!! Thanks for the great explanation...

  • @aminomar7890
    @aminomar7890 3 роки тому +1

    I had the same problem, searched the web, they talk too much but making it more complicated than it is ! such a people usually don not understand good, because who understand can make it easier to digest not harder! "talk too much but useless!"!
    you made it easy as it is ! many thanks...

  • @ozzyfromspace
    @ozzyfromspace 3 роки тому

    Could I solve CORS errors? Yes. Did I understand them? No. Then you came along.
    Thank you, Hussein! You’re awesome man, I hope you never lose your sense of excitement ✨🙏🏽💯🎊

  • @barakdabach4232
    @barakdabach4232 2 роки тому

    great deep explanation, looked forever for a practical example of CORS, great job!!

  • @shubham_srt
    @shubham_srt 2 роки тому +2

    these type of explainations are what a student wants! showing the wrong thig too! Having knowledge and Teaching both are different skills. Wonder when will Universities understand that

    • @ashrafal
      @ashrafal 8 місяців тому +1

      Often University Teachers(in many countries) are Master Graduates(worse Bachelor doing part time Masters) who have not done much of real world programming. Their academic projects are in JAVA or even C++. They might be good at concept of DS & Algorithms, DB, if they are real good they might have deep understanding of Networking & OS. But, they not much understanding of webservers or web development. CORS might be something they have never come across.

  • @fahadshovon2713
    @fahadshovon2713 4 роки тому

    I have seen this error and solved this error by using third party libraries for 2 years . Today I finally understood the concept !!!
    Thanks a bunch for this great video!!

    • @hnasr
      @hnasr  4 роки тому +1

      Excellent! thanks Fahad for your comment , glad this helps

  • @simonarnold7094
    @simonarnold7094 4 роки тому +1

    I feel like I will watch this video a lot. I tend to forget how CORS works on a regular basis. Fortunately, this video is enjoyable to watch :)

    • @hnasr
      @hnasr  4 роки тому

      Its funny I made the video and I forget subtle differences in CORS messages as well. Thanks for your comment ❤️

  • @labixiaoxin1307
    @labixiaoxin1307 3 роки тому +2

    Take the time to watch this video of 23 minutes, and then you won't need to waste time anymore to understand cors in the future. A well-explained detailed long video is way more valuable than 100000000000 short 2-3 minutes not well-explained videos / articles, because you're gonna watch them again again again and again and still don't get it, until the end of your life.

  • @atexnik
    @atexnik 3 роки тому

    I'm not a developer, but still was able to absolutely comprehend the tutorial, and that helped me to troubleshoot the application! THANK YOU!

    • @hnasr
      @hnasr  3 роки тому +1

      Thanks Alex!! Glad that helped 🙏

  • @SaifUlIslam-di5xv
    @SaifUlIslam-di5xv 3 роки тому +3

    Back when you had so little views. Now, you're one of the most notable backend developers out here on UA-cam.
    Time and consistency do wonder!

    • @hnasr
      @hnasr  3 роки тому +2

      All love to you thanks!!

  • @abhishekpawar8458
    @abhishekpawar8458 3 роки тому +1

    I'd got lost in documentation. Thank God, I found you

  • @VeaceslavBARBARII
    @VeaceslavBARBARII 4 роки тому

    Finally I've got the concept behind the CORS.
    Thanks friend!

    • @hnasr
      @hnasr  4 роки тому

      Your welcome! Glad it helps

  • @Sendilien
    @Sendilien Рік тому +1

    If you go to watch another video in the series, you might see that they are just giving the answer to the actual problem right away. That way no-one can learn. Instead after watching those videos, one might find himself looking through another reference or watching another video. But your way of making intentional mistakes and sound-changes like "zzzz" while zooming out and in are really fun. So, only if there are more tutorials like this out there to make the learning curve funner and more adventurous.
    Now, don't need watch another one)

  • @ParveenSharma-ee9gl
    @ParveenSharma-ee9gl Рік тому

    Thanks for the practical introduction to CORS. Great video

  • @borisivkovic1995
    @borisivkovic1995 3 роки тому

    Probably the best video you can find about CORS Policy.
    Concise, with great examples and amazing narrative.
    Well done Hussein!

  • @jamesbest2221
    @jamesbest2221 2 роки тому

    This is the best video on cors that I’ve ever seen! Thank you!

  • @stevenondieki5498
    @stevenondieki5498 3 роки тому

    Wooow. I don't think I was gonna understand this concept elsewhere. I've subscribed too..can't wait to learn more here

  • @umituzun6837
    @umituzun6837 3 роки тому

    Really entertaining and basic understandable tutor I have ever see. I have read lots of documents about CORS, but that video was smashed the walls between me and CORS. Thank you very much. God bless you.

  • @luisbalza3774
    @luisbalza3774 3 роки тому

    Please Mr. Hussein, don't let this video disappear. It's an actual treasure

  • @ajit555db
    @ajit555db 4 роки тому +2

    Very accurate, simple, no-nonsense, enjoyable explanation, thanks a lot for the efforts.

  • @therealjayz8036
    @therealjayz8036 2 роки тому

    I’ve been reading a book about same origin policy and CORS. This video crystallizes those concepts. Thanks for the awesome content

  • @KnightsTemplar1987
    @KnightsTemplar1987 3 роки тому

    Exactly what I have been looking for. This video should be the first in google search response. Great Job taking the pain to elaborate everything. Kudos!!

  • @Joodlett
    @Joodlett 4 роки тому

    Appreciate the energy you bring to the video, beats the usual dulcet tones on most!

    • @hnasr
      @hnasr  4 роки тому +1

      Joodlett thanks 😊 I appreciate you noticing.. i try to lighten the mood in the videos. sometimes it works but sometimes ppl report it as distracting and I try to find the balance..

    • @Joodlett
      @Joodlett 4 роки тому

      @@hnasr works for me, I've subbed and I'll be sure to check out your channel!

  • @basedonprinciple
    @basedonprinciple 3 роки тому

    My first time exploring CORS and now I understand it's rules set up by your/a server regarding what requests it allows (from whom, etc.). Thank you!

  • @adityanagesh4922
    @adityanagesh4922 3 роки тому

    I like your videos first then starts watching. Never regretted. 🙂

    • @hnasr
      @hnasr  3 роки тому +1

      Yay! Thank you!

  • @KDOERAK
    @KDOERAK 3 роки тому

    two years later, still a great video!

    • @hnasr
      @hnasr  3 роки тому

      ❤️❤️

  • @sg9257
    @sg9257 3 місяці тому

    Being 5 years old, this still has to be the best CORS resource on internet.

  • @sagartyagi2450
    @sagartyagi2450 3 роки тому +1

    Finally understood CORS.

  • @arunmurugan2060
    @arunmurugan2060 3 роки тому +2

    Started to love software engineering because of your content. Thanks for your work and never stop making useful videos :)

    • @hnasr
      @hnasr  3 роки тому

      Thanks Arun!

  • @sviatoslav8776
    @sviatoslav8776 2 роки тому

    Very clear and full explanation man. Thank you for your work.

  • @nagarajunagari2266
    @nagarajunagari2266 3 роки тому

    I was ZERO, after watching ur session, I'm feeling like HERO.. Thanks alot sir.. 🙏.

  • @uscjake868
    @uscjake868 2 роки тому

    Super duper good. Explaining code by doing the same things a newbie would do with lots of missed steps or broken steps. Slowly stepping through each line of code IS the best way to teach this.

  • @marydzekh7590
    @marydzekh7590 11 місяців тому

    Thank you very much for this extremely detailed and straight-forward explanation!
    7:42 SERVED SUCCESSFULLYYYY - this one has made my day🤣

  • @ultiumlabs4899
    @ultiumlabs4899 3 роки тому

    It helped me a lot understanding CORS, thank you Hussein

  • @3208nandu
    @3208nandu 3 роки тому +1

    Really amazed by your way of teaching and enthusiasm. Thanks for such neat and very understandable examples

  • @tasheemhargrove9650
    @tasheemhargrove9650 3 роки тому

    Thank you Hussein! I was stuck on this problem for hours. I'm still learning how to build basic applications. I have a simple client application with some HTML, bootstrap, and Javascript using the XMLHttpRequest object to connect to a simple Java Spring API I have as a separate application. I kept running into this CORS problem, and as a read more and solved one issue, another issue would pop up. I knew that there was something I was missing in my understanding of CORS. Now, I have a much better understanding of what's going on with the browser and how it's handling the requests and responses 🙏

  • @SouravRoy-mt7fb
    @SouravRoy-mt7fb 3 роки тому +2

    Quality content ... No one can explain better than you. 👍.. creating top notch content for free deserves respect and salute 🙏

  • @gomesbcc
    @gomesbcc Рік тому

    Perfect explanation, example guided. Love it. Thanksss

  • @alphabeta4149
    @alphabeta4149 4 роки тому +1

    Thank goodness, someone who makes IT videos without sounding like a robot fucked a dictionary. Bless you bro. Will be back for more. Subbed!

    • @hnasr
      @hnasr  4 роки тому

      I laughed so hard 😂 thanks bro

  • @KhaledAl-Naami
    @KhaledAl-Naami 22 дні тому

    Thank you Sir! Very well explained. You got a wonderful talent.

  • @mikeacuin
    @mikeacuin 4 роки тому +2

    WOW! This is exactly the video I was looking for. Thanks Mr. Nasser! More power to you!

  • @obadzafar6731
    @obadzafar6731 Рік тому

    Thank you, your explanation is just wonderful. more power to you.

  • @hell-o8470
    @hell-o8470 3 роки тому

    Thanks a lot. Got to know soo much about cors. Also, I like your way of teaching 💯

  • @ihor_1995
    @ihor_1995 3 роки тому

    The video is awesome! Thank you Hussein.

  • @snooter28
    @snooter28 4 роки тому +2

    Bro, I'd donate you some money for this video 110%. You've earned a subscription out of this alone.

  • @hanspeterqwe6620
    @hanspeterqwe6620 3 роки тому

    Slow start, but god this was fun to watch. Just learned so much in 20min.

  • @manishsharma9490
    @manishsharma9490 3 роки тому

    Super video!! you made this concept really very clear to understand! :)

  • @nessun00x81
    @nessun00x81 4 роки тому +1

    thanks mate, this video is pure gold!!! I've been struggling for some days trying to fully understand this CORS stuff and now with your examples + my php experiments I'm crushing it :)

    • @hnasr
      @hnasr  4 роки тому

      nessun00x thanks for your comment!! So happy I could help .. go crush it 💪

  • @akshaykrishnan4778
    @akshaykrishnan4778 4 роки тому +1

    Great content!
    On OSX, if you hover on the green full screen button on the top left of a window, it allows you to split screen. Nice and easy way to prevent all the window switches.

    • @hnasr
      @hnasr  4 роки тому

      Thanks for the tip! I ll use it for sure

  • @muhammadisawijayakusuma5912
    @muhammadisawijayakusuma5912 3 роки тому

    You are so funny when explaining something, but good explanation.

  • @threeone6012
    @threeone6012 3 роки тому

    Best video on CORS. Nice job!

  • @shahinbayat
    @shahinbayat 4 роки тому

    I have always been struggling with my nodejs server fixing "CORS" 😤 issues and NOW I know the errors' meaning and what cors package is actually doing behind the scenes. Thanks mate for presenting these network topics so comprehensive and fun. Your channel definitely deserves much more subs. 🚀

    • @hnasr
      @hnasr  4 роки тому +1

      Shahin!! Thank you 😊 I appreciate you.

  • @suyashpurwar8310
    @suyashpurwar8310 3 роки тому

    You are doing a great job sir! Keep posting! Literally wondering why I discovered your channel so late.

  • @code_breakerZZ
    @code_breakerZZ 4 роки тому +1

    Subscribed! really nice tutorial! I am able to solve issues with chrome's browser latest update with this video. Thank you so much!

    • @hnasr
      @hnasr  4 роки тому

      Happy this helps 😊 welcome to channel

  • @schnasndasn1504
    @schnasndasn1504 4 роки тому +1

    Thank you very much for this awesome tutorial. I finally understood it fully.
    Your accent is great and a pleasure to hear :)

    • @hnasr
      @hnasr  4 роки тому

      😊🙏 thanks!!!

  • @ismelitomalonzo5519
    @ismelitomalonzo5519 2 роки тому

    Thank you. Your presentation helped me a lot.

  • @smashed5826
    @smashed5826 4 роки тому

    Nice video! You are the first guy that when teaching coding looks like getting high :). I know CORS what, how, but still searching examples to tell me why in security angles

  • @ConsuelaPlaysRS
    @ConsuelaPlaysRS 4 роки тому +2

    Great content & fun to watch - good job being yourself. The bit where you were trying to pronounce "granular" was pretty funny, especially when you said "goddamit" under your breath. Keep it up!

  • @waynewatson7970
    @waynewatson7970 4 роки тому

    you sharing Hussein helps out so much, thanks

    • @hnasr
      @hnasr  4 роки тому +1

      Wayne Watson thank you Wayne! Glad it helps!

  • @randydouglas434
    @randydouglas434 3 роки тому

    I don't know Python yet, but this was super helpful for understanding my CORS issue. Thanks!

  • @daberee9666
    @daberee9666 3 роки тому

    Hey Hussein, I very very rarely make comments, so you should know this video was very helpful in my understanding of web server and client relationship especially in code because you had the simplest server and built on it. Your explanation is very GRANULAR and I love your accent haha. Keep the content coming 😅😅

  • @amiturfnd
    @amiturfnd 4 роки тому

    Best cors video ever. Thanks sir.

  • @sna241
    @sna241 4 роки тому +1

    Amazing video! I like how you dived deep into the coding part.

  • @mahyarazad
    @mahyarazad 3 роки тому

    You're so awesome, man. I do enjoy your explanation about CORS.

  • @10akashmehta
    @10akashmehta 3 роки тому

    Very nice explanation, this is the kind of stuff I need to really understand what is going on behind the scenes. Hussein gives really great examples in his videos. I just found out this channel and started watching videos. I have a lot to learn now!

  • @phaneedrakumaribharadwaj2392
    @phaneedrakumaribharadwaj2392 День тому

    Event English is not first language its sooo nice wonderful explanation

  • @yonihod199
    @yonihod199 3 роки тому

    Explained brilliantly!

  • @aarya8333
    @aarya8333 2 роки тому

    Wow for first time I like the video and the trainer the way he explains. By heart I hate coding as I am not a developer

  • @kappaj01
    @kappaj01 4 роки тому +1

    Seriously great stuff Hussein!!! Stunning explanation

    • @hnasr
      @hnasr  4 роки тому

      Thanks Andre!! Cheers and have a great day.

  • @hellyeahhydra8747
    @hellyeahhydra8747 2 роки тому

    love ur sense of humor. Can you please make full stack tutorials using react,node and postgres or mongo

  • @Hussain-su7dg
    @Hussain-su7dg 2 роки тому

    Thank you so much Hussain,you make amazing videos .Please never stop that ,its so helpful to understand at the "granular"😛 level .Loved it

  • @AIwithAniket
    @AIwithAniket 3 роки тому +1

    Loved the explanation

  • @willieb.1746
    @willieb.1746 3 роки тому

    thank you for this tutorial, it is very helpful to see these concepts of SOP and CORS in a ral simple example

  • @MrRorypam
    @MrRorypam 4 роки тому +1

    Really Great . Clearly this explains. Thank you so much

  • @eddiegomez4134
    @eddiegomez4134 4 роки тому

    Super helpful & entertaining! Thanks for this!

    • @hnasr
      @hnasr  4 роки тому

      Thanks Eddie!!

  • @vishwanathtontanal6617
    @vishwanathtontanal6617 4 роки тому

    Really ice explanation.. Thank you so much for your detailed explanations...

    • @hnasr
      @hnasr  4 роки тому

      🙏 thank you ! Happy you liked the CORS video Vishwanath

  • @99rellik
    @99rellik 5 років тому +3

    Thank you. This was very informative and very useful.

    • @hnasr
      @hnasr  5 років тому

      Sean Turner thanks Sean for watching. Glad you enjoyed the content :)

  • @iorusoul
    @iorusoul 2 роки тому

    Thanks I was stuck for days with a cors issue :'D

  • @goldfishbrainjohn2462
    @goldfishbrainjohn2462 3 роки тому

    I already subscribed your channel and liked this video as well.
    Thank you for making a video like his, teaching us such valuable knowledge!

  • @bdafeesh
    @bdafeesh 4 роки тому

    Excellent explanation. Very clear and concise :)

    • @hnasr
      @hnasr  4 роки тому

      Thank you Blake 😊 happy you enjoyed the content.

  • @palaniappanrm6277
    @palaniappanrm6277 4 роки тому +1

    Big eye opener again 👌

  • @hosseinbehdarvandi1504
    @hosseinbehdarvandi1504 6 місяців тому

    You have an amazing personality

  • @mgcmsn
    @mgcmsn 4 роки тому +1

    Great explanation, thank you very much!

  • @csrescued1299
    @csrescued1299 4 роки тому +1

    Thank you very much @hussein...i've been struggling to understand CORS concept and you really did clear that through An epic example :) Again thanks to you, I really mean it