View Issue Details

IDProjectCategoryView StatusLast Update
0037104FPCFCLpublic2020-05-18 18:52
ReporterFabio Luis Girardi Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityunable to reproduce
Status closedResolutionfixed 
Platformx86_64OSLinux 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0037104: Patch to add two features
DescriptionThis patch adds two features to fcl-web

1) TCustomSession.SessionVariableExists : Checks if some variable exists in the current session. Implemented into TIniWebSession too.
2) The ability to process the HTTP field If-None-Match correctly.
Steps To ReproduceNone
Tagsfcl-web
Fixed in Revision45421
FPCOldBugId
FPCTarget4.0.0
Attached Files

Activities

Fabio Luis Girardi

2020-05-18 16:22

reporter  

patch.diff (2,724 bytes)   
Index: httpdefs.pp
===================================================================
--- httpdefs.pp	(revisão 45419)
+++ httpdefs.pp	(cópia de trabalho)
@@ -89,7 +89,7 @@
   FieldCookie = HeaderCookie deprecated;
   FieldSetCookie = HeaderSetCookie deprecated;
 
-  NoHTTPFields    = 27;
+  NoHTTPFields    = 28;
 
   HTTPDateFmt     = httpProtocol.HTTPDateFmt;
   SCookieExpire   = httpProtocol.SCookieExpire;
@@ -129,7 +129,7 @@
                  fieldFrom, fieldIfModifiedSince, fieldLastModified, fieldLocation,
                  fieldPragma, fieldReferer, fieldRetryAfter, fieldServer,
                  fieldSetCookie, fieldUserAgent, fieldWWWAuthenticate,
-                  fieldHost, fieldCacheControl,fieldXRequestedWith) deprecated;
+                  fieldHost, fieldCacheControl,fieldXRequestedWith,fieldIfNoneMatch) deprecated;
 
   // Map header names on indexes in property getter/setter. 0 means not mapped !
   HTTPFieldIndexes : THTTPIndexes
@@ -140,7 +140,7 @@
                        14,15,16,17,
                        18,19,20,21,
                        22,23,24,
-                       34,0,36) deprecated;
+                       34,0,36,26) deprecated;
 
 
 
@@ -553,6 +553,8 @@
     Procedure RemoveVariable(VariableName : String); virtual; abstract;
     // Terminate session
     Procedure Terminate; virtual; abstract;
+    // checks if session variable exists
+    Function SessionVariableExists(VarName : String) : Boolean; Virtual; abstract;
     // Session timeout in minutes
     Property TimeOutMinutes : Integer Read FTimeOut Write FTimeOut default 15;
     // ID of this session.
@@ -1092,7 +1094,7 @@
        6,7,8,
        9,-1,-1,-1,
        10,12,-1,13,-1,
-       14,34,-1,15,-1,
+       14,34,-1,15,26,
        -1,-1,16,17,-1,
        18,-1,-1,-1,19,
        20,21,-1,-1,
Index: iniwebsession.pp
===================================================================
--- iniwebsession.pp	(revisão 45419)
+++ iniwebsession.pp	(cópia de trabalho)
@@ -46,6 +46,7 @@
   Public
     Destructor Destroy; override;
     Procedure Terminate; override;
+    function SessionVariableExists(VarName: String): Boolean; override;
     Procedure UpdateResponse(AResponse : TResponse); override;
     Procedure InitSession(ARequest : TRequest; OnNewSession, OnExpired: TNotifyEvent); override;
     Procedure InitResponse(AResponse : TResponse); override;
@@ -359,6 +360,12 @@
   RemoveFromSessionState(ssExpired);
 end;
 
+function TIniWebSession.SessionVariableExists(VarName: String): Boolean;
+begin
+  CheckSession;
+  Result:=FIniFile.ValueExists(SData,VarName);
+end;
+
 procedure TIniWebSession.UpdateResponse(AResponse: TResponse);
 begin
   // Do nothing. Init has done the job.
patch.diff (2,724 bytes)   

Michael Van Canneyt

2020-05-18 17:07

administrator   ~0122904

Checked and applied, thank you very much for the patch!

Fabio Luis Girardi

2020-05-18 18:52

reporter   ~0122905

I that should say thank you

Issue History

Date Modified Username Field Change
2020-05-18 16:22 Fabio Luis Girardi New Issue
2020-05-18 16:22 Fabio Luis Girardi File Added: patch.diff
2020-05-18 16:25 Fabio Luis Girardi Tag Attached: fcl-web
2020-05-18 16:40 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-05-18 16:40 Michael Van Canneyt Status new => assigned
2020-05-18 17:07 Michael Van Canneyt Status assigned => resolved
2020-05-18 17:07 Michael Van Canneyt Resolution open => fixed
2020-05-18 17:07 Michael Van Canneyt Fixed in Version => 3.3.1
2020-05-18 17:07 Michael Van Canneyt Fixed in Revision => 45421
2020-05-18 17:07 Michael Van Canneyt FPCTarget => 4.0.0
2020-05-18 17:07 Michael Van Canneyt Note Added: 0122904
2020-05-18 18:52 Fabio Luis Girardi Status resolved => closed
2020-05-18 18:52 Fabio Luis Girardi Note Added: 0122905