Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon4.gif   http status 200 returned for "file not found", posted by Konstantin Olchanski on Fri Mar 18 00:36:37 2022 
    icon2.gif   Re: http status 200 returned for "file not found", posted by Alexey Khudyakov on Tue Jan 30 13:10:38 2024 
       icon2.gif   Re: http status 200 returned for "file not found", posted by Stefan Ritt on Fri Feb 23 14:59:29 2024 
Message ID: 69741     Entry time: Fri Feb 23 14:59:29 2024     In reply to: 69726
Icon: Reply  Author: Stefan Ritt  Author Email: stefan.ritt@psi.ch 
Category: Bug report  OS: Linux  ELOG Version: ELOG V3.1.5 
Subject: Re: http status 200 returned for "file not found" 
> > "file not found" should return http code 404. elogd returns code 200 together
> > with a page containing text "404 not found". This pollutes the browser cache
> > with wrong content (in this case, we are trying to load a css file, and the browser
> > is trying to use text "404 not found" as if it were a css. bad. file not found
> > should return http code 404. K.O.
> 
> Yes. That's quite a problem when interacting with ELOG programmatically. Only way to 
> find whether response succeeded or failed with 404 is to parse response body
> 
> When file is not found send_file_direct calls show_html_header which in turn calls 
> show_http_header which sets HTTP code 200 unconditionally. It's reasonably easy to 
> patch around.

I fixed the code to properly return "404 Not Found" in case a non-existing file is requested.

Stefan
ELOG V3.1.5-fe60aaf