Skip to content

Commit

Permalink
trim end slashes of the server URL (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac authored Mar 29, 2024
1 parent 4290fc7 commit 56bf897
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ COPY --from=builder /app/ndc-cli /ndc-cli

ENV HASURA_CONFIGURATION_DIRECTORY /config

ENTRYPOINT ["/ndc-cli"]

# Run the web service on container startup.
CMD ["/ndc-cli", "serve"]
CMD ["serve"]
2 changes: 1 addition & 1 deletion rest/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func applyEnvVariablesToSchema(input *rest.NDCRestSchema, logger *slog.Logger) *
if input.Settings != nil {
input.Settings.Headers = replaceEnvTemplateInHeader(input.Settings.Headers, logger)
for i, server := range input.Settings.Servers {
server.URL = replaceEnvTemplate(server.URL, logger)
server.URL = strings.TrimRight(replaceEnvTemplate(server.URL, logger), "/")
input.Settings.Servers[i] = server
}
for key, ss := range input.Settings.SecuritySchemes {
Expand Down

0 comments on commit 56bf897

Please sign in to comment.