-
-
Advanced Policy Expressions: Working with Dates, Times, and Numbers
-
Advanced Policy Expressions: Parsing HTTP, TCP, and UDP Data
-
Advanced Policy Expressions: IP and MAC Addresses, Throughput, VLAN IDs
-
-
-
-
Content-length header behavior in a rewrite policy
-
Rewrite Action and Policy Examples
-
This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
Content-Length header behavior in a streaming rewrite action
Content-Length header is one of the ways to indicate the length of the message (in bytes) in an HTTP request or response. Apart from the Content-Length header, you can also specify the length of the message by using one of the following ways:
- Chunked encoding
- FIN Termination
In a streaming process, the NetScaler sends data continuously after processing the rewrite action. As the data is sent continuously and not held by the NetScaler, the actual length of the message that would be sent to the client is unknown. Therefore, the correct value of the Content-Length header cannot be mentioned in the response.
To support the streaming process, the rewrite feature of NetScaler converts the way to indicate the length of the message from the Content-Length header to the FIN termination. As part of the conversion, the NetScaler corrupts the Content-Length header by rearranging the first four characters of the header name.
In HTTP, the client is expected to ignore headers that it does not understand. So the client does not understand the corrupted Content-Length header name and therefore ignores the header. To improve the performance of the NetScaler, the header is corrupted instead of deleted. Corrupting the header name instead of deleting avoids recomputing the checksum because the checksum is not changed if the same bytes are in a different order.
For example, consider the following HTTP request:
GET / HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, /
Accept-Language: en-GB
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; CMDTDF; MS-RTC LM 8)
Accept-Encoding: gzip, deflate
Host: test.example.net
Connection: Keep-Alive
<!--NeedCopy-->
In a working scenario, the response between NetScaler and the back-end server for this HTTP request is as follows:
HTTP/1.1 200 OK
Content-Length: 10967
Connection: close
var SERVER_URL = 'https\x3a\x2f\x2ftest.example.net\x2f';
var WEB_SERVER_HOST = 'test.example.net';
<!--NeedCopy-->
But the response received by the client from NetScaler in a non-working scenario is as follows. The Content-Length
header is renamed to ntcoent-Length
.
HTTP/1.1 200 OK
ntCoent-Length: 10967
nnCoection: close
var SERVER_URL = 'https\x3a\x2f\x2ftest.example.net\x2f';
var WEB_SERVER_HOST = 'test.example.net';
<!--NeedCopy-->
In general, the client applications support all the three ways of transaction - Content-Length header, Chunked encoding, and FIN Termination. So, the conversion from Content-Length header to FIN Termination must not cause any issue. But, if the application doesn’t work because of this modification, then you must Disable the streaming process.
How to disable the streaming process in a rewrite policy
You can disable the streaming process in a rewrite policy using one of the following ways:
-
Add a non-streaming action associated with a rewrite policy that is bound at a higher priority. The action must be in such a way that it doesn’t modify the response.
For example:
add rewrite action non_stream_act replace_all HTTP.RES.BODY(1000000) HTTP.RES.FULL_HEADER -search text("pattern_which_will_not_match_in_body")
The value of the body in this rewrite action must be more than the value on which the current streaming action is working.
-
Instead of the streaming configuration, use the non-streaming configuration.
Note:
Moving from streaming to non-streaming processing might impact the performance of the NetScaler.
For example, a streaming configuration can be converted to a non-streaming configuration as follows:
Streaming Configuration:
add rewrite action rw_act_1 replace_all HTTP.RES.BODY(1000) "\"http\"" -search text("http") add policy patset pat_list bind policy patset pat_list abcd bind policy patset pat_list defg add rewrite action rw_act_2 replace_all HTTP.RES.BODY(1000) "\"replaced_data\"" -search patset("pat_list") <!--NeedCopy-->
Non-streaming configuration:
add rewrite action rw_act_1 replace_all HTTP.RES.BODY(1000) "\"http\"" -search regex(re/http/) add rewrite action rw_act_1 replace_all HTTP.RES.BODY(1000) "\"http\"" -search regex(re/abcd|defg/) <!--NeedCopy-->
Share
Share
This Preview product documentation is Cloud Software Group Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Cloud Software Group Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Cloud Software Group product purchase decisions.
If you do not agree, select I DO NOT AGREE to exit.