Ignore:
Timestamp:
Sep 9, 2022, 9:41:42 PM (2 years ago)
Author:
chronos
Message:
  • Fixed: Better handle invalid not found pages including correct HTTP code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/ZdechovNET/UWebCamPage.pas

    r138 r139  
    5353      CameraId := -1;
    5454      NotFound := False;
    55       if Request.Path.Count >= 2 then begin
     55      if Request.Path.Count = 2 then begin
    5656        SubPageName := Request.Path[1];
    5757        if TryStrToInt(SubPageName, Value) then
    5858          CameraId := Value else
    5959          NotFound := True;
    60       end;
    61       if not NotFound then begin
    62     //for I := 0 to HandlerData.Request.Query.Count - 1 do
    63       //Text := Text + HandlerData.Request.Query[I] + ' ';
    64 
    65       //HandlerData.Request.Query.Values['W'] := 'dsd';
    66       //HandlerData.Request.Query.Values['H'] := 'dsd';
     60      end else
     61      if Request.Path.Count > 2 then NotFound := True;
     62      if NotFound then begin
     63        PageNotFound;
     64        Exit;
     65      end;
     66
    6767      if HandlerData.Request.Query.TryGetValue('W', WidthValue) then
    6868        ImageWidth := StrToInt(WidthValue)
     
    9191
    9292      Text := Text + '<br/><strong>Kamery v okolí:</strong><br />' +
    93         '<a href="http://www.mestovsetin.cz/vismo/dokumenty2.asp?id_org=18676&amp;id=480245">Vsetínské kamery</a><br />' +
     93        '<a href="https://www.mestovsetin.cz/webove%2Dkamery/d-480245">Vsetínské kamery</a><br />' +
    9494        '<a href="https://www.huslenky.cz/webkamery%2Dhuslenky/ds-1119/archiv=0&amp;p1=1020">Kamery v Huslenkách</a><br/>' +
    95         '<a href="http://kamery.hovnet.cz/">Kamery v Hovnetu</a><br/>' +
     95        '<a href="https://kamery.hovnet.cz/">Kamery v Hovnetu</a><br/>' +
    9696        '</td><td style="width: 80%" valign="top">';
    9797
     
    101101        Text := Text + GetSingle(HandlerData, CameraId);
    102102      end;
    103 
    104103      Text := Text + '</td></tr></table>';
    105       end else Text := 'Stránka nenalezena.';
    106104    end;
    107105    GeneratePage(Self);
Note: See TracChangeset for help on using the changeset viewer.