带阿里标识的版本

This commit is contained in:
robin
2026-02-28 18:55:33 +08:00
parent 150799f41d
commit 5d0b7c7e91
477 changed files with 10813 additions and 4044 deletions

View File

@@ -1,9 +1,9 @@
//
// HttpdnsNWHTTPClientTestHelper.h
// AlicloudHttpDNSTests
// TrustHttpDNSTests
//
// @author Created by Claude Code on 2025-11-01
// Copyright © 2025 alibaba-inc.com. All rights reserved.
// Copyright © 2025 trustapp.com. All rights reserved.
//
#import <Foundation/Foundation.h>
@@ -12,20 +12,20 @@ NS_ASSUME_NONNULL_BEGIN
@interface HttpdnsNWHTTPClientTestHelper : NSObject
#pragma mark - HTTP 响应数据构
#pragma mark - HTTP 响应数据构<EFBFBD><EFBFBD>?
// 构造标HTTP 响应数据
// 构造标<EFBFBD><EFBFBD>?HTTP 响应数据
+ (NSData *)createHTTPResponseWithStatus:(NSInteger)statusCode
statusText:(NSString *)statusText
headers:(nullable NSDictionary<NSString *, NSString *> *)headers
body:(nullable NSData *)body;
// 构chunked 编码HTTP 响应
// 构<EFBFBD><EFBFBD>?chunked 编码<EFBFBD><EFBFBD>?HTTP 响应
+ (NSData *)createChunkedHTTPResponseWithStatus:(NSInteger)statusCode
headers:(nullable NSDictionary<NSString *, NSString *> *)headers
chunks:(NSArray<NSData *> *)chunks;
// 构chunked 编码HTTP 响应(带 trailers
// 构<EFBFBD><EFBFBD>?chunked 编码<EFBFBD><EFBFBD>?HTTP 响应(带 trailers<EFBFBD><EFBFBD>?
+ (NSData *)createChunkedHTTPResponseWithStatus:(NSInteger)statusCode
headers:(nullable NSDictionary<NSString *, NSString *> *)headers
chunks:(NSArray<NSData *> *)chunks
@@ -36,18 +36,18 @@ NS_ASSUME_NONNULL_BEGIN
// 编码单个 chunk
+ (NSData *)encodeChunk:(NSData *)data;
// 编码单个 chunk带 extension
// 编码单个 chunk带 extension<EFBFBD><EFBFBD>?
+ (NSData *)encodeChunk:(NSData *)data extension:(nullable NSString *)extension;
// 编码终止 chunksize=0
// 编码终止 chunksize=0<EFBFBD><EFBFBD>?
+ (NSData *)encodeLastChunk;
// 编码终止 chunk带 trailers
// 编码终止 chunk带 trailers<EFBFBD><EFBFBD>?
+ (NSData *)encodeLastChunkWithTrailers:(NSDictionary<NSString *, NSString *> *)trailers;
#pragma mark - 测试数据生成
// 生成指定大小的随机数
// 生成指定大小的随机数<EFBFBD><EFBFBD>?
+ (NSData *)randomDataWithSize:(NSUInteger)size;
// 生成 JSON 格式的响应体