Fix: Accept-Enconding header

This commit is contained in:
ThisIsDara
2026-05-08 07:41:51 +03:30
parent 08ba77d13e
commit 07ad4415a1
2 changed files with 41 additions and 23 deletions
+33 -21
View File
@@ -9,7 +9,28 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
- os: windows-latest
goos: windows
goarch: amd64
- os: windows-latest
goos: windows
goarch: arm64
- os: windows-latest
goos: windows
goarch: 386
runs-on: ${{ matrix.os }}
permissions:
contents: write
@@ -21,21 +42,18 @@ jobs:
with:
go-version: '1.22'
- name: Build Linux
if: matrix.os == 'ubuntu-latest'
run: GOOS=linux go build -ldflags "-s -w" -o mhr-cfw-go-linux ./cmd/mhr-cfw
- name: Build
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags "-s -w" -o mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/mhr-cfw
- name: Build Windows
if: matrix.os == 'windows-latest'
run: go build -ldflags "-s -w" -o mhr-cfw-go-windows.exe ./cmd/mhr-cfw
- name: Rename Windows executable
if: matrix.goos == 'windows'
run: Move-Item mhr-cfw-go-windows-${{ matrix.goarch }} mhr-cfw-go-windows-${{ matrix.goarch }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: mhr-cfw-go-${{ matrix.os }}
path: |
mhr-cfw-go-windows.exe
mhr-cfw-go-linux
name: mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }}
path: mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }}*
release:
needs: build
@@ -46,24 +64,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Download Linux artifact
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: mhr-cfw-go-ubuntu-latest
path: .
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: mhr-cfw-go-windows-latest
path: .
- name: List artifacts
run: Get-ChildItem -Recurse -File | Select-Object -ExpandProperty FullName
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
mhr-cfw-go-windows.exe
mhr-cfw-go-linux
files: mhr-cfw-go-*
body: "Built from commit ${{ github.sha }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+7 -1
View File
@@ -507,7 +507,13 @@ func (f *DomainFronter) buildPayload(method, urlStr string, headers map[string]s
"r": false,
}
if headers != nil {
p["h"] = headers
filtered := make(map[string]string)
for k, v := range headers {
if strings.ToLower(k) != "accept-encoding" {
filtered[k] = v
}
}
p["h"] = filtered
}
if len(body) > 0 {
p["b"] = base64.StdEncoding.EncodeToString(body)