@@ -84,6 +84,16 @@ def __build_user_agent(self):
8484 user_agent += ' {0}/{1}' .format (self .app_id , self .app_version )
8585 return user_agent
8686
87+ # The list of paths that require HTTP override in header
88+ list_httpoverride = [
89+ '/v2/shopping/flight-offers' ,
90+ '/v1/shopping/seatmaps' ,
91+ '/v1/shopping/availability/flight-availabilities' ,
92+ '/v2/shopping/flight-offers/prediction' ,
93+ '/v1/shopping/flight-offers/pricing?' ,
94+ '/v1/shopping/flight-offers/upselling'
95+ ]
96+
8797 # Builds a HTTP Request object based on the path, params, and verb
8898 def __build_http_request (self ):
8999 # Requests token in case has not been set
@@ -95,18 +105,9 @@ def __build_http_request(self):
95105 # Adds the authentication header since the bearer token has been set
96106 self .headers ['Authorization' ] = self .bearer_token
97107
98- # List of paths that require HTTP override in header
99- list_httpoverride = [
100- '/v2/shopping/flight-offers' ,
101- '/v1/shopping/seatmaps' ,
102- '/v1/shopping/availability/flight-availabilities' ,
103- '/v2/shopping/flight-offers/prediction' ,
104- '/v1/shopping/flight-offers/pricing?' ,
105- '/v1/shopping/flight-offers/upselling'
106- ]
107-
108108 if self .verb == 'POST' :
109- if self .path in list_httpoverride :
109+ #Adds HTTP override in Header for the list of paths required
110+ if self .path in Request .list_httpoverride :
110111 self .headers ['X-HTTP-Method-Override' ] = 'GET'
111112 if type (self .params ) is dict :
112113 return HTTPRequest (self .url , headers = self .headers , method = 'POST' ,
0 commit comments