Update httpserver to 1.6.5

This commit is contained in:
Luis Ángel San Martín
2016-06-22 19:09:04 +02:00
parent 44d7c892c1
commit 706e0921f3
22 changed files with 1491 additions and 1198 deletions

View File

@ -8,6 +8,7 @@
#include <QList>
#include <QByteArray>
#include "httpglobal.h"
/**
HTTP cookie as defined in RFC 2109. This class can also parse
@ -15,7 +16,7 @@
2109.
*/
class HttpCookie
class DECLSPEC HttpCookie
{
public:
@ -30,9 +31,10 @@ public:
@param path Path for that the cookie will be sent, default="/" which means the whole domain
@param comment Optional comment, may be displayed by the web browser somewhere
@param domain Optional domain for that the cookie will be sent. Defaults to the current domain
@param secure If true, the cookie will only be sent on secure connections
@param secure If true, the cookie will be sent by the browser to the server only on secure connections
@param httpOnly If true, the browser does not allow client-side scripts to access the cookie
*/
HttpCookie(const QByteArray name, const QByteArray value, const int maxAge, const QByteArray path="/", const QByteArray comment=QByteArray(), const QByteArray domain=QByteArray(), const bool secure=false);
HttpCookie(const QByteArray name, const QByteArray value, const int maxAge, const QByteArray path="/", const QByteArray comment=QByteArray(), const QByteArray domain=QByteArray(), const bool secure=false, const bool httpOnly=false);
/**
Create a cookie from a string.
@ -40,7 +42,7 @@ public:
*/
HttpCookie(const QByteArray source);
/** Convert this cookie to a string that may be used in a Set-Cookie2 header. */
/** Convert this cookie to a string that may be used in a Set-Cookie header. */
QByteArray toByteArray() const ;
/**
@ -67,9 +69,12 @@ public:
/** Set the path for that the cookie will be sent, default="/" which means the whole domain */
void setPath(const QByteArray path);
/** Set secure mode, so that the cokkie will only be sent on secure connections */
/** Set secure mode, so that the cookie will be sent by the browser to the server only on secure connections */
void setSecure(const bool secure);
/** Set secure mode, so that he browser does not allow client-side scripts to access the cookie */
void setHttpOnly(const bool httpOnly);
/** Get the name of this cookie */
QByteArray getName() const;
@ -91,6 +96,9 @@ public:
/** Get the secure flag of this cookie */
bool getSecure() const;
/** Get the httpOnly of this cookie */
bool getHttpOnly() const;
/** Returns always 1 */
int getVersion() const;
@ -103,6 +111,7 @@ private:
int maxAge;
QByteArray path;
bool secure;
bool httpOnly;
int version;
};