@@ -0,0 +1,1827 @@
+#Author:Shoaib Omar (C) 2015%0A#Modify HDANA if needed.%0A#COLLECTION OF ALL FUNCTIONS NEEDED TO BE USED ACROSS SERVER(Global Functions)%0AHDANA = %5B%22content-type%22,%22accept-ranges%22,%22content-length%22,%22etag%22%5D#-MUST BE IN LOWER CASE-HeaderDuplicatesAreNotALlowed these headers will have their values replaced if duplicate custom headers are present%0A%0A#Construct Output Header%0Adef Construct_Header(Custom_Headers,Keep_Alive,Mime,Cont_Size,Code=%22200 OK%22,Ranges=%22bytes%22):%0A%09Response=%22HTTP/1.1 %22+Code+%22%5CnServer: SHB/1.0 (SHB)%5CnContent-Type: %22+Mime+%22;%5CnContent-Length: %22+Cont_Size+%22%5CnAccept-Ranges: %22+Ranges+%22%5CnConnection: %22+Keep_Alive+%22%5Cn%5Cn%22%0A%09if (Custom_Headers != %22%22):%0A%09%09Custom_Header_Array = Custom_Headers.split(%22%5Cn%22)%0A%09%09for Header in Custom_Header_Array:%0A%09%09%09#Useless header detection%0A%09%09%09if not(%22:%22 in Header):%0A%09%09%09%09continue#Do not bother with use less headers%0A%09%09%09#Useless header detection%0A%09%09%09Split_Loc = Header.find(%22:%22)%0A%09%09%09Tmp_Header_Holder = %5BHeader%5B:Split_Loc%5D.strip(),Header%5BSplit_Loc+1:%5D.strip()%5D%0A%09%09%09Tmp_Header_HolderL = Tmp_Header_Holder%5B0%5D.lower()%0A%09%09%09#Special Case%0A%09%09%09if %22status%22 in Tmp_Header_HolderL:%0A%09%09%09%09Response = Response.replace(Code,Tmp_Header_Holder%5B1%5D)%0A%09%09%09%09continue#Skip this header%0A%09%09%09#Special Case%0A%09%09%09#Avoid Duplicates?%0A%09%09%09if ((Tmp_Header_HolderL in Response.lower()) & (Tmp_Header_HolderL in HDANA)): #Avoid duplicates in special cases%0A%09%09%09%09Rsp_header_val = Response%5BResponse.lower().index(Tmp_Header_HolderL)+len(Tmp_Header_Holder%5B0%5D)+1:%5D.split(%22%5Cn%22)%5B0%5D.strip()%0A%09%09%09%09Response = Response.replace(Rsp_header_val,Tmp_Header_Holder%5B1%5D)%0A%09%09%09else:%0A%09%09%09%09Response = Response%5B:-(len(%22%5CnConnection: %22+Keep_Alive+%22%5Cn%5Cn%22)-1)%5D+Header+%22%5Cn%22+Response%5B-(len(%22%5CnConnection: %22+Keep_Alive+%22%5Cn%5Cn%22)-1):%5D%0A%09%09%09#Avoid Duplicates?%0A%09return Response%0A#Construct Output Header%0A%0A%0A#COLLECTION OF ALL FUNCTIONS NEEDED TO BE USED ACROSS SERVER(Global Functions)%0A

Create GF.py