weixin_39988197
weixin_39988197
2020-11-30 09:08

Gin support

From #24 for #22

Implements a wrapper/gin subpackage as drop-in replacement for Gin Gonic users.

Example and simple tests are included.

该提问来源于开源项目:rs/cors

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39988197 weixin_39988197 5月前

    hmm... should I update Travis CI matrix?

    点赞 评论 复制链接分享
  • weixin_39982537 weixin_39982537 5月前

    In what context would you need to wrap an existing cors?

    点赞 评论 复制链接分享
  • weixin_39988197 weixin_39988197 5月前

    can we switch to go 1.9 in Travis CI?

    I'd rather not make gin.Options as new type type Options cors.Options and leave it a type alias type Options = cors.Options for better interop.

    点赞 评论 复制链接分享
  • weixin_39982537 weixin_39982537 5月前

    Ok

    点赞 评论 复制链接分享
  • weixin_39982537 weixin_39982537 5月前

    I just looked at the gin doc. Why don't you just use gin.WrapH?

    点赞 评论 复制链接分享
  • weixin_39988197 weixin_39988197 5月前

    because gin.WrapH() won't abort Gin middlewares chain for preflights. To abort middlewares chain someone somewhere should call ctx.Abort().

    点赞 评论 复制链接分享
  • weixin_39982537 weixin_39982537 5月前

    Ok got it, thx.

    点赞 评论 复制链接分享