@@ -147,6 +147,11 @@ templates._make_header_template_func = function(is_request_headers)
147147 var TYPE = 0 ;
148148 var STR = 1 ;
149149 var attrs = [ "class" , "header-token-type-" + cls . HTTPHeaderTokenizer . classnames [ token [ TYPE ] ] ] ;
150+ if ( token [ TYPE ] === cls . HTTPHeaderTokenizer . types . NAME )
151+ {
152+ attrs . extend ( [ "data-spec" , "http#" + token [ STR ] ] ) ;
153+ }
154+ else
150155 if ( token [ TYPE ] === cls . HTTPHeaderTokenizer . types . FIRST_LINE_PART )
151156 {
152157 if ( firstline_tokens in add_data_spec )
@@ -202,20 +207,7 @@ templates._request_headers = function(req, do_raw)
202207 }
203208 else
204209 {
205- if ( req . firstline )
206- {
207- var parts = req . firstline . split ( " " ) ;
208- var firstline ;
209- if ( parts . length == 3 )
210- {
211- firstline = [
212- [ "span" , parts [ 0 ] + " " , "data-spec" , "http#" + parts [ 0 ] ] ,
213- [ "span" , parts [ 1 ] + " " ] ,
214- [ "span" , parts [ 2 ] + " " ]
215- ] ;
216- }
217- ret . extend ( this . headers_list ( req . request_headers , firstline ) ) ;
218- }
210+ ret . extend ( this . headers_list ( req . request_headers ) ) ;
219211 }
220212 return [ "tbody" , ret . map ( this . _wrap_col_or_row ) ] ;
221213} ;
@@ -246,29 +238,17 @@ templates._response_headers = function(resp, do_raw)
246238 }
247239
248240 var ret = [ ] ;
249-
250- var firstline ;
251- var parts = resp . firstline . split ( " " , 2 ) ;
252- if ( parts . length == 2 )
253- {
254- firstline = [
255- [ "span" , parts [ 0 ] + " " ] ,
256- [ "span" , parts [ 1 ] , "data-spec" , "http#" + parts [ 1 ] ] ,
257- [ "span" , resp . firstline . slice ( parts [ 0 ] . length + parts [ 1 ] . length + 1 ) ]
258- ] ;
259- }
260-
261241 if ( resp . logger_entry_touched_network )
262242 ret . push ( [ "h2" , ui_strings . S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE ] ) ;
263243
264- ret . extend ( this . headers_list ( resp . response_headers , firstline ) ) ;
244+ ret . extend ( this . headers_list ( resp . response_headers ) ) ;
265245 return [ "tbody" , ret . map ( this . _wrap_col_or_row ) ] ;
266246} ;
267247
268- templates . headers_list = function ( headers , firstline , do_raw )
248+ templates . headers_list = function ( headers , do_raw )
269249{
270250 var map_func ;
271- if ( do_raw ) // this is currently just for headers of parts in multipart. todo: in regular request/response headers we'll have a tokenized list to gain speclinks .
251+ if ( do_raw ) // This is just for headers of multipart-parts .
272252 {
273253 map_func = function ( header )
274254 {
@@ -282,13 +262,7 @@ templates.headers_list = function(headers, firstline, do_raw)
282262 return [ [ "th" , header . name + ":" , "data-spec" , "http#" + header . name ] , [ "td" , header . value ] ] ;
283263 } ;
284264 }
285-
286- var lis = headers . map ( map_func ) ;
287- if ( firstline )
288- {
289- lis . unshift ( [ "pre" , firstline , "class" , "mono" ] ) ;
290- }
291- return lis ;
265+ return headers . map ( map_func ) ;
292266} ;
293267
294268templates . _request_body = function ( req , do_raw )
@@ -297,7 +271,7 @@ templates._request_body = function(req, do_raw)
297271 return [ ] ;
298272
299273 var ret = [ this . _wrap_pre ( "\n" ) ] ;
300- if ( req . requestbody . partList . length ) // multipart
274+ if ( req . requestbody . partList . length ) // Multipart
301275 {
302276 var use_raw_boundary = false ;
303277 if ( do_raw && req . boundary )
@@ -308,7 +282,7 @@ templates._request_body = function(req, do_raw)
308282 if ( use_raw_boundary && n === 0 )
309283 ret . push ( this . _wrap_pre ( req . boundary ) ) ;
310284
311- ret . extend ( this . headers_list ( part . headerList , null , do_raw ) ) ;
285+ ret . extend ( this . headers_list ( part . headerList , do_raw ) ) ;
312286 ret . push ( this . _wrap_pre ( "\n" ) ) ;
313287 if ( part . content && part . content . stringData )
314288 ret . push ( [ "pre" , part . content . stringData , "class" , "mono network-body" ] ) ;
@@ -333,7 +307,7 @@ templates._request_body = function(req, do_raw)
333307 ret . push ( [
334308 [ "th" , ui_strings . S_LABEL_NETWORK_POST_DATA_NAME ] ,
335309 [ "th" , ui_strings . S_LABEL_NETWORK_POST_DATA_VALUE ]
336- ] ) ; // it 's necesary to just push the outer array, because each entry will be wrapped in a row.
310+ ] ) ; // It 's necesary to just push the outer array, because each entry will be wrapped in a row.
337311
338312 ret . extend ( parts . map ( function ( e ) {
339313 e = e . replace ( / \+ / g, "%20" ) . split ( "=" ) ;
0 commit comments