Giter Site home page Giter Site logo

Comments (6)

DanielRamp avatar DanielRamp commented on May 22, 2024 3

Finally I was able to try it.

The default http error 404 for unknown/not existing domains works as expected.

Also I'm sorry for not answering. I was really happy when I saw your comments but haven't had enough time to test it and give feedback, also didn't want to just write something like "cool, testing it soon..."

from error-pages.

tarampampam avatar tarampampam commented on May 22, 2024 2

Version 2.3.0 has been published! Everything should be fine after the update :) Feel free to close this issue after checking on your side.

from error-pages.

tarampampam avatar tarampampam commented on May 22, 2024 2

@DanielRamp ping :)

from error-pages.

DanielRamp avatar DanielRamp commented on May 22, 2024 1

Did I understand you correctly, you want always http response code 200 even if these are error pages?

Because this new behaviour is not what I see as "normal" from big websites (1, 2) and also breaks for example a statuspage.
In previous versions of error-pages a statuspage could just request the page every minute or so and if the response http code is 200 it's "healthy/up".

Or is there something I have to set in my reverse proxy (traefik) configuration to get this desired result back?

from error-pages.

tarampampam avatar tarampampam commented on May 22, 2024
$ docker run --rm -d -p "8080:8080/tcp" tarampampam/error-pages

$ curl -v http://127.0.0.1:8080/foobar
*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /foobar HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Date: Wed, 29 Dec 2021 10:13:57 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 80
< 
* Connection #0 to host 127.0.0.1 left intact
Wrong request URL. Error pages are available at the following URLs: /{code}.html

$ curl -v http://127.0.0.1:8080/500.html
*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /500.html HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Wed, 29 Dec 2021 10:14:46 GMT
< Content-Type: text/html; charset=utf-8
...

For the non-existing page status code is 404, for the error page with code 500 - the response code is 200. Should we change something? I think - no :)

from error-pages.

tarampampam avatar tarampampam commented on May 22, 2024

Oh, sorry, you're right... For the non-existing domains response code should be not 200. I have made a flag --default-error-page, but forgot about the response code customization. I will make a fix shortly, thanks for your issue!

from error-pages.

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.