http: fix cookies (part 2)
							parent
							
								
									9f6e4a86e9
								
							
						
					
					
						commit
						3d19167628
					
				|  | @ -49,7 +49,7 @@ pub: | ||||||
| 
 | 
 | ||||||
| pub fn new_request(method, url_, data string) ?Request { | pub fn new_request(method, url_, data string) ?Request { | ||||||
| 	url := if method == 'GET' { url_ + '?' + data } else { url_ } | 	url := if method == 'GET' { url_ + '?' + data } else { url_ } | ||||||
| 	println('new req() method=$method url="$url" dta="$data"') | 	//println('new req() method=$method url="$url" dta="$data"')
 | ||||||
| 	return Request{ | 	return Request{ | ||||||
| 		method: method.to_upper() | 		method: method.to_upper() | ||||||
| 		url: url | 		url: url | ||||||
|  | @ -364,7 +364,7 @@ fn (req &Request) build_request_headers(method, host_name, path string) string { | ||||||
| 		if key == 'Cookie' { | 		if key == 'Cookie' { | ||||||
| 			continue | 			continue | ||||||
| 		} | 		} | ||||||
| 		uheaders << '${key}=${val}\r\n' | 		uheaders << '${key}: ${val}\r\n' | ||||||
| 	} | 	} | ||||||
| 	uheaders << req.build_request_cookies_header() | 	uheaders << req.build_request_cookies_header() | ||||||
| 	return '$method $path HTTP/1.1\r\n' + uheaders.join('') + 'Connection: close\r\n\r\n' + | 	return '$method $path HTTP/1.1\r\n' + uheaders.join('') + 'Connection: close\r\n\r\n' + | ||||||
|  |  | ||||||
|  | @ -3091,7 +3091,7 @@ pub fn (mut c Checker) enum_val(mut node ast.EnumVal) table.Type { | ||||||
| 		typ_sym = c.table.get_type_symbol(typ) | 		typ_sym = c.table.get_type_symbol(typ) | ||||||
| 	} | 	} | ||||||
| 	if typ_sym.kind != .enum_ { | 	if typ_sym.kind != .enum_ { | ||||||
| 		c.error('expected type is not an enum', node.pos) | 		c.error('expected type is not an enum (`$typ_sym.name`)', node.pos) | ||||||
| 		return table.void_type | 		return table.void_type | ||||||
| 	} | 	} | ||||||
| 	if typ_sym.info !is table.Enum { | 	if typ_sym.info !is table.Enum { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue