How can URL be blocked even before loading?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Klen
    • Aug 2006
    • 32235

    #1

    How can URL be blocked even before loading?

    Some CPA networks are blocking access to URL if you dont have right GEO, but URL is not loading at all, meaning you click go and nothing happens. If you would for example, block geo on firewall level, then URL would be throw timeout error after some time. Or if you would put geo block on PHP level you could throw an 403 error. I guess this must javascript thing, but i find it silly to block on pre-load instead redirecting incorrect traffic to somewhere else.
  • redwhiteandblue
    Bollocks
    • Jun 2007
    • 2793

    #2
    What headers are being received?
    Interserver unmanaged AMD Ryzen servers from $73.00

    Comment

    • Klen
      • Aug 2006
      • 32235

      #3
      Originally posted by redwhiteandblue
      What headers are being received?
      First normal 302 and then this:
      GET: HTTP/2.0 204 No Content
      server: nginx
      date: Wed, 05 Apr 2023 12:06:44 GMT
      accept-ch: Sec-Ch-Ua-Platform-Version
      vary: Origin
      x-eflow-request-id: 25d25269-4bc8-4472-bb89-c94cb7049112
      via: 1.1 google
      alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
      X-Firefox-Spdy: h2
      ---------------------

      Comment

      • redwhiteandblue
        Bollocks
        • Jun 2007
        • 2793

        #4
        So I guess if the server sends the 204 code then the browser just does nothing when it sees it and that's why nothing happens but it's not considered an error.
        Interserver unmanaged AMD Ryzen servers from $73.00

        Comment

        • Klen
          • Aug 2006
          • 32235

          #5
          Originally posted by redwhiteandblue
          So I guess if the server sends the 204 code then the browser just does nothing when it sees it and that's why nothing happens but it's not considered an error.
          Yeah, kind a self-explanatory But i am just used to see either redirect or error message so find it to be weird policy.

          Comment

          • Kittens
            👏 REVOLUTIONARY 👏
            • Jan 2016
            • 1440

            #6
            Originally posted by Klen
            Yeah, kind a self-explanatory But i am just used to see either redirect or error message so find it to be weird policy.
            204 is to tell the browser that the request was successful but no content is sent back so no need to parse the body... Usually used in API's and non-GET methods... What URL are you trying hit that gives you that?

            Comment

            • ladida
              Confirmed User
              • Nov 2005
              • 2179

              #7
              Lol this guy knows nothing about how internet works
              Javascript )))))
              agentGFY *at* gmail.com

              Comment

              • brassmonkey
                Pay It Forward
                • Sep 2005
                • 77397

                #8
                they don't waste time anymore. they just turn off the lights. someone i know was talking about that early this morning
                TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
                DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

                Comment

                • fuzebox
                  making it rain
                  • Oct 2003
                  • 22353

                  #9
                  There's a lot of reasons why a network or offer would just drop the clicks. Could be a liability of showing content in certain geos, could be for privacy, could be an over zealous fraud protection.

                  Most companies do not want to redirect other geos to a competitor for whatever reason either. 99% of affiliates that make sales aren't just sending unfiltered untargeted traffic so it should not be a big deal in most cases.

                  Comment

                  • Klen
                    • Aug 2006
                    • 32235

                    #10
                    Originally posted by Kittens
                    204 is to tell the browser that the request was successful but no content is sent back so no need to parse the body... Usually used in API's and non-GET methods... What URL are you trying hit that gives you that?
                    It's a CPA network offer which allows only US traffic. But anyway, i figured out how it's done in PHP:

                    PHP Code:
                    <?php
                    ob_start();
                    
                    header("HTTP/1.1 204 NO CONTENT");
                    
                    header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
                    header("Pragma: no-cache"); // HTTP 1.0.
                    header("Expires: 0"); // Proxies.
                    
                    ob_end_flush(); //now the headers are sent
                    
                    
                    
                    ?>
                    Produces same effect.

                    Comment

                    • Klen
                      • Aug 2006
                      • 32235

                      #11
                      Originally posted by ladida
                      Lol this guy knows nothing about how internet works
                      Javascript )))))
                      I actually know better then how internet works then most of people, but in order to proper debug you need to start with silly questions in order to rule out invalid things.My first guess was javascript because nothing happens in browser, like i did not clicked go at all, and i associate javascript with browser manipulation. And i never seen this 204 status code in action before, only 401,403,404,500,301 and 302.

                      Comment

                      • Kittens
                        👏 REVOLUTIONARY 👏
                        • Jan 2016
                        • 1440

                        #12
                        Originally posted by Klen
                        It's a CPA network offer which allows only US traffic. But anyway, i figured out how it's done in PHP:

                        PHP Code:
                        <?php
                        ob_start();
                        
                        header("HTTP/1.1 204 NO CONTENT");
                        
                        header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
                        header("Pragma: no-cache"); // HTTP 1.0.
                        header("Expires: 0"); // Proxies.
                        
                        ob_end_flush(); //now the headers are sent
                        
                        
                        
                        ?>
                        Produces same effect.
                        Been almost a decade since I wrote PHP, but AFAIK this should suffice.

                        PHP Code:
                        <?php
                        http_response_code(204);
                        ?>

                        Comment

                        • Klen
                          • Aug 2006
                          • 32235

                          #13
                          Originally posted by Kittens
                          Been almost a decade since I wrote PHP, but AFAIK this should suffice.

                          PHP Code:
                          <?php
                          http_response_code(204);
                          ?>
                          Nice, love it when i can shorten code.

                          Comment

                          • brassmonkey
                            Pay It Forward
                            • Sep 2005
                            • 77397

                            #14
                            ahhh you are trying to duplicate it? the code place would have given you good answers.
                            TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
                            DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

                            Comment

                            • pornmasta
                              Too lazy to set a custom title
                              • Jun 2006
                              • 20019

                              #15
                              Htaccess ?

                              Comment

                              Working...