Skip to content

Commit

Permalink
language support check
Browse files Browse the repository at this point in the history
  • Loading branch information
srujangit123 committed Dec 26, 2024
1 parent 706908d commit 225eec9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ func RegisterRoutes(r *gin.Engine, client codecontainer.ContainerClient, config
zap.Any("request params", req),
)

if !config.IsLanguageSupported(req.Language) {

Check failure on line 24 in cmd/routes.go

View workflow job for this annotation

GitHub Actions / build (amd64)

config.IsLanguageSupported undefined (type *config.ImageConfig has no field or method IsLanguageSupported)

Check failure on line 24 in cmd/routes.go

View workflow job for this annotation

GitHub Actions / build (arm64)

config.IsLanguageSupported undefined (type *config.ImageConfig has no field or method IsLanguageSupported)
logger.Error("unsupported language",
zap.String("language", string(req.Language)),
)
ctx.JSON(http.StatusBadRequest, gin.H{"error": "Unsupported language"})
return
}

code := &codecontainer.Code{
EncodedCode: req.EncodedCode,
EncodedInput: req.EncodedInput,
Expand Down

0 comments on commit 225eec9

Please sign in to comment.