Ticket #374 (closed defect: wontfix)

Opened 3 years ago

Last modified 2 years ago

HTTP Response codes inaccurate

Reported by: anonymous Owned by:
Priority: minor Milestone: Community Related Issues
Component: Core Version: 1.7.4
Keywords: Cc:
MoSCoW: none Estimated time after impact analysis:
Related to project: none Tested: no
Accepted: no Estimated Hours:

Description

When a still image <vpx_still_url> is requested for the first time, it shows the still image. The HTTP response is:

HTTP/1.1 200 OK
Date: Fri, 08 Oct 2010 12:36:07 GMT
Server: Apache/2.2.3 (Red Hat)
X-Powered-By: PHP/5.2.10
Content-Length: 3480
Connection: close
Content-Type: image/jpeg

When a request is made to the same <vpx_still_url> for a second time, the still is not available anymore. The HTTP response is:

HTTP/1.1 200 OK
Date: Fri, 08 Oct 2010 12:39:51 GMT
Server: Apache/2.2.3 (Red Hat)
X-Powered-By: PHP/5.2.10
Content-Length: 14
Connection: close
Content-Type: text/html; charset=UTF-8

The body of the response is showing "File not found".

The HTTP response code should be 404 and not 200. This behaviour is wrong and is confusing client applications (caching for instance) and doesn't conform to REST principles. This happens everywhere where die() function is used.
I have added corresponding http response codes.

$/mediamosa/still/index.php

line: 15

die("Unable to connect to VPX");

replace with:

header("HTTP/1.1 500 Internal Server Error", false, 500);
die("Unable to connect to VPX");

line: 18

die("Invalid mountpoint received");

replace with:

header("HTTP/1.1 500 Internal Server Error", false, 500);
die("Invalid mountpoint received");

line: 31

die("Invalid parameter");

replace with:

header("HTTP/1.1 400 Bad Request", false, 400);
die("Invalid parameter");

line: 38

die("File not found");

replace with:

header("HTTP/1.1 404 Not Found", false, 404);
die("File not found");

$/mediamosa/download/index.php

line: 23

die("Unable to connect to VPX");

replace with:

header("HTTP/1.1 500 Internal Server Error", false, 500);
die("Unable to connect to VPX");

line: 26

die("Invalid mountpoint received");

replace with:

header("HTTP/1.1 500 Internal Server Error", false, 500);
die("Invalid mountpoint received");

line: 36

die("Invalid parameter");

replace with:

header("HTTP/1.1 400 Bad Request", false, 400);
die("Invalid parameter");

line: 42

die("Invalid download ticket");

replace with:

header("HTTP/1.1 404 Not Found", false, 404);
die("Invalid download ticket");

line: 49

die("File not found");

replace with:

header("HTTP/1.1 404 Not Found", false, 404);
die("File not found");

Running version 1.7.5 (missing in dropdown selection)

Bye, Tom Kuipers

Change History

Changed 3 years ago by robert

  • status set to closed
  • resolution set to wontfix

Hi Tom,

thanks for your report.

Your issue for v1.7.5 has been already fixed in v2.x, so for the sort time until release of v2 we are not going to fix this. Those die() calls are replaced by exception throws and the whole still code is now a REST call handling the call.

Also in v2.3 we will introduce static still links, where its no longer needed to return the still image using PHP, but the web-server will handle them. As where stills with ACL rules will use the REST call, without will be static using web-server. In other words, a lot of improvements in v2.

Changed 2 years ago by Frans

  • milestone changed from MediaMosa X.X to Community Related Issues
Note: See TracTickets for help on using tickets.