()
| 175 | |
| 176 | // Migration examples showing before/after the fix |
| 177 | function showMigrationExamples() { |
| 178 | console.log('\n📋 Migration Guide - Before vs After Issue #297 Fix:\n'); |
| 179 | |
| 180 | console.log('❌ BEFORE (would cause corruption):'); |
| 181 | console.log(' const response = await cycleTLS(url);'); |
| 182 | console.log(' const data = await response.text(); // Binary data corrupted as UTF-8\n'); |
| 183 | |
| 184 | console.log('✅ AFTER (preserves binary integrity):'); |
| 185 | console.log(' const response = await cycleTLS(url);'); |
| 186 | console.log(' const data = await response.arrayBuffer(); // Clean binary data\n'); |
| 187 | |
| 188 | console.log('🔧 For uploads:'); |
| 189 | console.log(' // Convert Buffer to binary string for transmission'); |
| 190 | console.log(' const binaryData = fs.readFileSync("image.jpg");'); |
| 191 | console.log(' const response = await cycleTLS(url, { body: binaryData.toString("binary") }, "POST");\n'); |
| 192 | } |
| 193 | |
| 194 | // Main execution |
| 195 | if (require.main === module) { |
no outgoing calls
no test coverage detected
searching dependent graphs…