Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrSaber committed Oct 13, 2024
2 parents f6a0581 + ad6e864 commit 441f359
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ name: Build
on:
push:
tags:
- 'v*'
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.21

- name: Cache Go modules
uses: actions/cache@v1
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies
run: go mod download

- name: Docker Login
- name: Container Registry Login
uses: docker/login-action@v1
with:
registry: ghcr.io
Expand All @@ -41,6 +41,6 @@ jobs:
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
5 changes: 2 additions & 3 deletions .github/workflows/tests.yaml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Run tests

on:
push
on: push

jobs:
run-tests:
Expand All @@ -14,7 +13,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '1.18'
go-version: 1.21

- name: Run tests
run: go test -v -race -timeout 5s ./...
2 changes: 0 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ builds:
archives:
- format: binary
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
replacements:
darwin: macOS

dockers:
- dockerfile: goreleaser.dockerfile
Expand Down
6 changes: 3 additions & 3 deletions src/models/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ type Redirect struct {
func (redirect Redirect) ResolvePath(request *http.Request) string {
toUrl, _ := url.Parse(redirect.To)

if strings.Contains(toUrl.Hostname(), "*") {
toSections := strings.Split(toUrl.Hostname(), ".")
requestSections := strings.Split(request.URL.Hostname(), ".")
if strings.Contains(toUrl.Host, "*") {
toSections := strings.Split(toUrl.Host, ".")
requestSections := strings.Split(request.Host, ".")

// Substitute every * in to with corresponding section in request
for i, section := range toSections {
Expand Down

0 comments on commit 441f359

Please sign in to comment.