CORS Protection: What is the point of HTTP_ORIGINWhat is the most efficient way to deep clone an object in JavaScript?What is the !! (not not) operator in JavaScript?What does “use strict” do in JavaScript, and what is the reasoning behind it?What is the difference between call and apply?Reference — What does this symbol mean in PHP?What does enctype='multipart/form-data' mean?How does Access-Control-Allow-Origin header work?CORS: Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is trueWhy does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?Response to preflight request doesn't pass access control check

How to prevent "they're falling in love" trope

If a warlock makes a Dancing Sword their pact weapon, is there a way to prevent it from disappearing if it's farther away for more than a minute?

Ambiguity in the definition of entropy

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

Does Dispel Magic work on Tiny Hut?

Why do I get negative height?

Is it possible to map the firing of neurons in the human brain so as to stimulate artificial memories in someone else?

Implication of namely

Can I hook these wires up to find the connection to a dead outlet?

Is there a hemisphere-neutral way of specifying a season?

Is this draw by repetition?

Did 'Cinema Songs' exist during Hiranyakshipu's time?

Knowledge-based authentication using Domain-driven Design in C#

How to coordinate airplane tickets?

Rotate ASCII Art by 45 Degrees

How to remove border from elements in the last row?

What historical events would have to change in order to make 19th century "steampunk" technology possible?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Can compressed videos be decoded back to their uncompresed original format?

How to travel to Japan while expressing milk?

Are British MPs missing the point, with these 'Indicative Votes'?

What exactly is ineptocracy?

Getting extremely large arrows with tikzcd

files created then deleted at every second in tmp directory



CORS Protection: What is the point of HTTP_ORIGIN


What is the most efficient way to deep clone an object in JavaScript?What is the !! (not not) operator in JavaScript?What does “use strict” do in JavaScript, and what is the reasoning behind it?What is the difference between call and apply?Reference — What does this symbol mean in PHP?What does enctype='multipart/form-data' mean?How does Access-Control-Allow-Origin header work?CORS: Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is trueWhy does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?Response to preflight request doesn't pass access control check













0















I'm currently developing a central AJAX script base for all of our domains (scripts.domain.com).



I have the following PHP code, which in theory would be good protection against bad CORS requests.



$valid_cors = array("domain1","domain2","domain3");
if(in_array($_SERVER['HTTP_ORIGIN'],"https://".$valid_cors))
header('Access-Control-Allow-Origin: https://$valid_cors', false);
header("Access-Control-Allow-Methods: GET, POST, PUT");
header("Access-Control-Allow-Headers: Content-Type");



I bet you can guess the message I'm receiving before you even read it. For those of you who can't, it is something along the lines of:




XMLHttpRequest cannot load
https://scripts.domain.com/scripts/ajax_caller.json?.
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'https://domain1' is therefore not allowed
access.




After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header, so basically the whole A-C-A-O system is completely pointless, because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it. You cannot put multiple A-O headers either, because browsers block the request altogether if there is more than one.



We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?



It makes no odds to me using the asterisk system because we check against CSRF & session when it is executed before any action files are called, but for most of the users this could seriously do more harm than good putting them into a false sense of security.



Please, can someone tell me I've got the wrong end of the stick here with this and that I'm using it wrong? There doesn't seem to be many people who can give an answer bar asterisk'ing it which makes me even more convinced this is the only way.










share|improve this question


























    0















    I'm currently developing a central AJAX script base for all of our domains (scripts.domain.com).



    I have the following PHP code, which in theory would be good protection against bad CORS requests.



    $valid_cors = array("domain1","domain2","domain3");
    if(in_array($_SERVER['HTTP_ORIGIN'],"https://".$valid_cors))
    header('Access-Control-Allow-Origin: https://$valid_cors', false);
    header("Access-Control-Allow-Methods: GET, POST, PUT");
    header("Access-Control-Allow-Headers: Content-Type");



    I bet you can guess the message I'm receiving before you even read it. For those of you who can't, it is something along the lines of:




    XMLHttpRequest cannot load
    https://scripts.domain.com/scripts/ajax_caller.json?.
    No 'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin 'https://domain1' is therefore not allowed
    access.




    After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header, so basically the whole A-C-A-O system is completely pointless, because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it. You cannot put multiple A-O headers either, because browsers block the request altogether if there is more than one.



    We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?



    It makes no odds to me using the asterisk system because we check against CSRF & session when it is executed before any action files are called, but for most of the users this could seriously do more harm than good putting them into a false sense of security.



    Please, can someone tell me I've got the wrong end of the stick here with this and that I'm using it wrong? There doesn't seem to be many people who can give an answer bar asterisk'ing it which makes me even more convinced this is the only way.










    share|improve this question
























      0












      0








      0


      0






      I'm currently developing a central AJAX script base for all of our domains (scripts.domain.com).



      I have the following PHP code, which in theory would be good protection against bad CORS requests.



      $valid_cors = array("domain1","domain2","domain3");
      if(in_array($_SERVER['HTTP_ORIGIN'],"https://".$valid_cors))
      header('Access-Control-Allow-Origin: https://$valid_cors', false);
      header("Access-Control-Allow-Methods: GET, POST, PUT");
      header("Access-Control-Allow-Headers: Content-Type");



      I bet you can guess the message I'm receiving before you even read it. For those of you who can't, it is something along the lines of:




      XMLHttpRequest cannot load
      https://scripts.domain.com/scripts/ajax_caller.json?.
      No 'Access-Control-Allow-Origin' header is present on the requested
      resource. Origin 'https://domain1' is therefore not allowed
      access.




      After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header, so basically the whole A-C-A-O system is completely pointless, because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it. You cannot put multiple A-O headers either, because browsers block the request altogether if there is more than one.



      We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?



      It makes no odds to me using the asterisk system because we check against CSRF & session when it is executed before any action files are called, but for most of the users this could seriously do more harm than good putting them into a false sense of security.



      Please, can someone tell me I've got the wrong end of the stick here with this and that I'm using it wrong? There doesn't seem to be many people who can give an answer bar asterisk'ing it which makes me even more convinced this is the only way.










      share|improve this question














      I'm currently developing a central AJAX script base for all of our domains (scripts.domain.com).



      I have the following PHP code, which in theory would be good protection against bad CORS requests.



      $valid_cors = array("domain1","domain2","domain3");
      if(in_array($_SERVER['HTTP_ORIGIN'],"https://".$valid_cors))
      header('Access-Control-Allow-Origin: https://$valid_cors', false);
      header("Access-Control-Allow-Methods: GET, POST, PUT");
      header("Access-Control-Allow-Headers: Content-Type");



      I bet you can guess the message I'm receiving before you even read it. For those of you who can't, it is something along the lines of:




      XMLHttpRequest cannot load
      https://scripts.domain.com/scripts/ajax_caller.json?.
      No 'Access-Control-Allow-Origin' header is present on the requested
      resource. Origin 'https://domain1' is therefore not allowed
      access.




      After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header, so basically the whole A-C-A-O system is completely pointless, because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it. You cannot put multiple A-O headers either, because browsers block the request altogether if there is more than one.



      We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?



      It makes no odds to me using the asterisk system because we check against CSRF & session when it is executed before any action files are called, but for most of the users this could seriously do more harm than good putting them into a false sense of security.



      Please, can someone tell me I've got the wrong end of the stick here with this and that I'm using it wrong? There doesn't seem to be many people who can give an answer bar asterisk'ing it which makes me even more convinced this is the only way.







      javascript php ajax http-headers cors






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 14 '17 at 2:02









      DL94DL94

      13012




      13012






















          1 Answer
          1






          active

          oldest

          votes


















          3















          After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header




          Well, that's not true. Anything supporting CORS supports sending the Origin request header.




          because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it




          No, that's also not true. Your server can respond differently, based on different origins.



          For example, if a request comes in with Origin: a.example.com, then you can respond with Access-Control-Allow-Origin: a.example.com.



          If a request comes in with Origin: b.example.com, you respond Access-Control-Allow-Origin: b.example.com.




          We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?




          CORS is not for protecting server resources. It's for isolating client access.



          As you know, web pages can include data from multiple origins. We do this all the time with images, scripts, etc. However, this only allows for us to see content from multiple origins. It doesn't allow the scripts from multiple origins to see each other's data.



          Suppose that wasn't the case... and that you could make cross-domain AJAX requests. Suppose I have a popular blog on investment advice. I know that people reading my blog also probably logged into their brokerage site recently. I could rig a script on my blog site that fires off AJAX requests to the brokerage site to make trades. The reason is that instead of the user making the request, now I'm making the request... but with their cookies. I can impersonate them without them even knowing! Scary stuff.



          In a more common example, a lot of home routers have admin panels with the default credentials. A lot of these routers also don't use the proper HTTP verbs... so a GET request can be used to do things like open up ports. These routers are still doomed as I can make a GET request with a simple image tag. Something like this:



          <img src="http://192.168.1.1/firewall/?action=openPort&port=22" />


          (Of course the "image" will fail to load, but the browser will have made the request and the router will have complied with it.)



          If the router used the correct verbs such as PUT or POST, it wouldn't be possible to make this change with a simple image tag. But without CORS, a page could make an AJAX request with a PUT or POST, taking control of your home router without you knowing! Basically, using your machine as a place to run privileged scripts.



          Preventing cross-origin access to resources in this way helps keep your privileged access safe.






          share|improve this answer

























          • According to developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/… multiple CORS header ‘Access-Control-Allow-Origin’ values are not allowed

            – tstuts
            Mar 8 at 17:45












          • @tstuts Thanks for pointing that out. I've updated the answer with correct information.

            – Brad
            Mar 8 at 21:11











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44534239%2fcors-protection-what-is-the-point-of-http-origin%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3















          After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header




          Well, that's not true. Anything supporting CORS supports sending the Origin request header.




          because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it




          No, that's also not true. Your server can respond differently, based on different origins.



          For example, if a request comes in with Origin: a.example.com, then you can respond with Access-Control-Allow-Origin: a.example.com.



          If a request comes in with Origin: b.example.com, you respond Access-Control-Allow-Origin: b.example.com.




          We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?




          CORS is not for protecting server resources. It's for isolating client access.



          As you know, web pages can include data from multiple origins. We do this all the time with images, scripts, etc. However, this only allows for us to see content from multiple origins. It doesn't allow the scripts from multiple origins to see each other's data.



          Suppose that wasn't the case... and that you could make cross-domain AJAX requests. Suppose I have a popular blog on investment advice. I know that people reading my blog also probably logged into their brokerage site recently. I could rig a script on my blog site that fires off AJAX requests to the brokerage site to make trades. The reason is that instead of the user making the request, now I'm making the request... but with their cookies. I can impersonate them without them even knowing! Scary stuff.



          In a more common example, a lot of home routers have admin panels with the default credentials. A lot of these routers also don't use the proper HTTP verbs... so a GET request can be used to do things like open up ports. These routers are still doomed as I can make a GET request with a simple image tag. Something like this:



          <img src="http://192.168.1.1/firewall/?action=openPort&port=22" />


          (Of course the "image" will fail to load, but the browser will have made the request and the router will have complied with it.)



          If the router used the correct verbs such as PUT or POST, it wouldn't be possible to make this change with a simple image tag. But without CORS, a page could make an AJAX request with a PUT or POST, taking control of your home router without you knowing! Basically, using your machine as a place to run privileged scripts.



          Preventing cross-origin access to resources in this way helps keep your privileged access safe.






          share|improve this answer

























          • According to developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/… multiple CORS header ‘Access-Control-Allow-Origin’ values are not allowed

            – tstuts
            Mar 8 at 17:45












          • @tstuts Thanks for pointing that out. I've updated the answer with correct information.

            – Brad
            Mar 8 at 21:11















          3















          After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header




          Well, that's not true. Anything supporting CORS supports sending the Origin request header.




          because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it




          No, that's also not true. Your server can respond differently, based on different origins.



          For example, if a request comes in with Origin: a.example.com, then you can respond with Access-Control-Allow-Origin: a.example.com.



          If a request comes in with Origin: b.example.com, you respond Access-Control-Allow-Origin: b.example.com.




          We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?




          CORS is not for protecting server resources. It's for isolating client access.



          As you know, web pages can include data from multiple origins. We do this all the time with images, scripts, etc. However, this only allows for us to see content from multiple origins. It doesn't allow the scripts from multiple origins to see each other's data.



          Suppose that wasn't the case... and that you could make cross-domain AJAX requests. Suppose I have a popular blog on investment advice. I know that people reading my blog also probably logged into their brokerage site recently. I could rig a script on my blog site that fires off AJAX requests to the brokerage site to make trades. The reason is that instead of the user making the request, now I'm making the request... but with their cookies. I can impersonate them without them even knowing! Scary stuff.



          In a more common example, a lot of home routers have admin panels with the default credentials. A lot of these routers also don't use the proper HTTP verbs... so a GET request can be used to do things like open up ports. These routers are still doomed as I can make a GET request with a simple image tag. Something like this:



          <img src="http://192.168.1.1/firewall/?action=openPort&port=22" />


          (Of course the "image" will fail to load, but the browser will have made the request and the router will have complied with it.)



          If the router used the correct verbs such as PUT or POST, it wouldn't be possible to make this change with a simple image tag. But without CORS, a page could make an AJAX request with a PUT or POST, taking control of your home router without you knowing! Basically, using your machine as a place to run privileged scripts.



          Preventing cross-origin access to resources in this way helps keep your privileged access safe.






          share|improve this answer

























          • According to developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/… multiple CORS header ‘Access-Control-Allow-Origin’ values are not allowed

            – tstuts
            Mar 8 at 17:45












          • @tstuts Thanks for pointing that out. I've updated the answer with correct information.

            – Brad
            Mar 8 at 21:11













          3












          3








          3








          After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header




          Well, that's not true. Anything supporting CORS supports sending the Origin request header.




          because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it




          No, that's also not true. Your server can respond differently, based on different origins.



          For example, if a request comes in with Origin: a.example.com, then you can respond with Access-Control-Allow-Origin: a.example.com.



          If a request comes in with Origin: b.example.com, you respond Access-Control-Allow-Origin: b.example.com.




          We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?




          CORS is not for protecting server resources. It's for isolating client access.



          As you know, web pages can include data from multiple origins. We do this all the time with images, scripts, etc. However, this only allows for us to see content from multiple origins. It doesn't allow the scripts from multiple origins to see each other's data.



          Suppose that wasn't the case... and that you could make cross-domain AJAX requests. Suppose I have a popular blog on investment advice. I know that people reading my blog also probably logged into their brokerage site recently. I could rig a script on my blog site that fires off AJAX requests to the brokerage site to make trades. The reason is that instead of the user making the request, now I'm making the request... but with their cookies. I can impersonate them without them even knowing! Scary stuff.



          In a more common example, a lot of home routers have admin panels with the default credentials. A lot of these routers also don't use the proper HTTP verbs... so a GET request can be used to do things like open up ports. These routers are still doomed as I can make a GET request with a simple image tag. Something like this:



          <img src="http://192.168.1.1/firewall/?action=openPort&port=22" />


          (Of course the "image" will fail to load, but the browser will have made the request and the router will have complied with it.)



          If the router used the correct verbs such as PUT or POST, it wouldn't be possible to make this change with a simple image tag. But without CORS, a page could make an AJAX request with a PUT or POST, taking control of your home router without you knowing! Basically, using your machine as a place to run privileged scripts.



          Preventing cross-origin access to resources in this way helps keep your privileged access safe.






          share|improve this answer
















          After reading some questions on here, it is my understanding that most browsers don't even send the HTTP_ORIGIN header




          Well, that's not true. Anything supporting CORS supports sending the Origin request header.




          because you've got to then put the Allow-Origin as an asterisk to allow multiple domains to call it




          No, that's also not true. Your server can respond differently, based on different origins.



          For example, if a request comes in with Origin: a.example.com, then you can respond with Access-Control-Allow-Origin: a.example.com.



          If a request comes in with Origin: b.example.com, you respond Access-Control-Allow-Origin: b.example.com.




          We all know by now - do not trust whatever a browser sends you as it can easily be faked, so why was this ever even considered to be implemented?




          CORS is not for protecting server resources. It's for isolating client access.



          As you know, web pages can include data from multiple origins. We do this all the time with images, scripts, etc. However, this only allows for us to see content from multiple origins. It doesn't allow the scripts from multiple origins to see each other's data.



          Suppose that wasn't the case... and that you could make cross-domain AJAX requests. Suppose I have a popular blog on investment advice. I know that people reading my blog also probably logged into their brokerage site recently. I could rig a script on my blog site that fires off AJAX requests to the brokerage site to make trades. The reason is that instead of the user making the request, now I'm making the request... but with their cookies. I can impersonate them without them even knowing! Scary stuff.



          In a more common example, a lot of home routers have admin panels with the default credentials. A lot of these routers also don't use the proper HTTP verbs... so a GET request can be used to do things like open up ports. These routers are still doomed as I can make a GET request with a simple image tag. Something like this:



          <img src="http://192.168.1.1/firewall/?action=openPort&port=22" />


          (Of course the "image" will fail to load, but the browser will have made the request and the router will have complied with it.)



          If the router used the correct verbs such as PUT or POST, it wouldn't be possible to make this change with a simple image tag. But without CORS, a page could make an AJAX request with a PUT or POST, taking control of your home router without you knowing! Basically, using your machine as a place to run privileged scripts.



          Preventing cross-origin access to resources in this way helps keep your privileged access safe.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 8 at 21:11

























          answered Jun 14 '17 at 2:21









          BradBrad

          117k29239398




          117k29239398












          • According to developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/… multiple CORS header ‘Access-Control-Allow-Origin’ values are not allowed

            – tstuts
            Mar 8 at 17:45












          • @tstuts Thanks for pointing that out. I've updated the answer with correct information.

            – Brad
            Mar 8 at 21:11

















          • According to developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/… multiple CORS header ‘Access-Control-Allow-Origin’ values are not allowed

            – tstuts
            Mar 8 at 17:45












          • @tstuts Thanks for pointing that out. I've updated the answer with correct information.

            – Brad
            Mar 8 at 21:11
















          According to developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/… multiple CORS header ‘Access-Control-Allow-Origin’ values are not allowed

          – tstuts
          Mar 8 at 17:45






          According to developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/… multiple CORS header ‘Access-Control-Allow-Origin’ values are not allowed

          – tstuts
          Mar 8 at 17:45














          @tstuts Thanks for pointing that out. I've updated the answer with correct information.

          – Brad
          Mar 8 at 21:11





          @tstuts Thanks for pointing that out. I've updated the answer with correct information.

          – Brad
          Mar 8 at 21:11



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44534239%2fcors-protection-what-is-the-point-of-http-origin%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

          Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

          How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page