return cleaner error when response not expected
This commit is contained in:
		
							parent
							
								
									bd72bbb1f3
								
							
						
					
					
						commit
						48fc41c4b8
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		|  | @ -479,6 +479,7 @@ pub fn Request(comptime request_action: anytype) type { | |||
|             const xml_options = xml_shaper.ParseOptions{ .allocator = options.client.allocator }; | ||||
|             var body: []const u8 = result.body; | ||||
|             var free_body = false; | ||||
|             if (result.body.len < 20) return error.UnexpectedResponse; | ||||
|             if (std.mem.lastIndexOf(u8, result.body[result.body.len - 20 ..], "Response>") == null and | ||||
|                 std.mem.lastIndexOf(u8, result.body[result.body.len - 20 ..], "Result>") == null) | ||||
|             { | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue