Skip to content

Commit

Permalink
Fix utf-8 base64 decode problem (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzkhrv authored Sep 23, 2023
1 parent 41f91ed commit 0fefe70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@types/xml2js": "^0.4.9",
"angular-cli-ghpages": "^1.0.0",
"angular-split": "^13.2.0",
"js-base64": "^3.7.5",
"rxjs": "~7.4.0",
"stream-browserify": "^3.0.0",
"timers-browserify": "^2.0.12",
Expand Down
5 changes: 3 additions & 2 deletions src/app/components/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { BurpExport } from '../../services/file-handle/file-handle.service'
import { Base64 } from 'js-base64';

@Component({
selector: 'app-main',
Expand Down Expand Up @@ -86,14 +87,14 @@ export class MainComponent implements OnInit {
let [key, ...value] = elem.split(": ")
header[index] = [key, value.join("")]
}, header);

return [header, body.join("")]
}

private atobReqRes(query: any): string {
try {
if (query[0].$.base64 === 'true') {
return atob(query[0]._ ?? "");
return Base64.decode(query[0]._ ?? "");
}
return query[0]._ ?? "";
} catch (error) {
Expand Down

0 comments on commit 0fefe70

Please sign in to comment.