小编str*_*y05的帖子

Safari - CORS OPTIONS 预检请求未显示在开发工具中

有谁知道如何让 Safari 在开发工具网络选项卡中显示 CORS 飞行前选项请求?

IIRC 他们曾经出现过,我知道正在发出请求,因为我们可以看到他们登录服务器。

我们在过去几周(Chrome 79/80 左右)突然出现了同样的问题,不得不通过设置chrome://flags/#out-of-blink-cors来强制它disable

safari cors preflight safari-web-inspector

17
推荐指数
0
解决办法
1568
查看次数

使用 Spring Cloud AWS RDS Aurora 的 Spring Boot 应用程序 - 如何分发读取查询

我有一个使用 AWS RDS 数据库的 Spring Boot 应用程序。

我正在尝试让 RDS Aurora / Postgres DB 与只读副本一起使用。我已经运行了应用程序,但是我看不到任何流向读取器节点的流量。

设置的是 Spring boot (2.2.7)、spring cloud aws 2.2.4-RELEASE、spring data (JpaRepository)。

RDS Aurora 集群有 2 个节点、1 个读取器和 1 个写入器,如下所示: AWS RDS 配置

控制器 GET 方法注释为@Transactional(readOnly = true)

    @RequestMapping(
            value = "/counters",
            produces = {"application/json"},
            method = RequestMethod.GET
    )
    @ResponseBody
    @Transactional(readOnly = true)
    public ResponseEntity<List<Counter>> getCounters()  {
        return ResponseEntity.of(Optional.of(this.counterDAO.findAll()));
    }
Run Code Online (Sandbox Code Playgroud)

最后Spring Cloud AWS配置

cloud:
  aws:
    region:
      static: ap-southeast-2
    credentials:
      accessKey: ${ACCESS_KEY}
      secretKey: ${SECRET_KEY}
    rds:
      rds-db-cluster-instance-1:
        password: ${POSTGRES_PASSWORD}
        username: postgres
        readReplicaSupport: "true" …
Run Code Online (Sandbox Code Playgroud)

java spring-boot amazon-aurora spring-cloud-aws

12
推荐指数
1
解决办法
5759
查看次数

Teams webhook - 在通知中发送表情符号

使用 slack webhooks,我可以使用消息中的短代码发送表情符号:

curl -X POST --data-urlencode "payload={\"channel\": \"#my_notification\",
\"username\": \"webhookbot\", \"text\": \":punch: commit blah deployed ok\",
\"icon_emoji\": \":ghost:\"}" https://hooks.slack.com/services/SOMELONGSTRING
Run Code Online (Sandbox Code Playgroud)

现在我们已经转移到 MS Teams,所以我正在使用传入的 webhook 连接器设置相同的东西,但是它似乎在客户端预请求中进行文本格式化,而不是像 slack 那样在客户端发布请求中进行渲染。所以这个网络钩子:

curl https://outlook.office.com/webhook/guid-guid-guid/IncomingWebhook/guid/guid 
--header 'Content-Type: application/json' 
--data "{ \"Text\": \":punch: commit blah deployed ok\", \"Title\" : \"api deployment\"}" 
Run Code Online (Sandbox Code Playgroud)

显示文字:punch:而不是酷炫的表情符号?我试过设置 TextFormat = markdown 但这没有任何区别。

如何将表情符号添加到我的团队通知中(使用字符串)并向我的同事证明团队不烂?

我应该指出我知道我可以在我的 Mac 上使用表情符号图标,但是通知是从 jenkins 发送的,我真的不想使用 shell 编码等来完成这项工作。

webhooks microsoft-teams

5
推荐指数
1
解决办法
4520
查看次数

Groovy Maven 编译失败并出现错误:无法确定 Groovy 版本。Groovy 是否被声明为依赖项?

我有一个使用 Maven 构建的相当普通的常规项目。它利用 gmavenplus 插件,直接从gmaven plus 网页提取 pom

pom 看起来像这样:

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.8.0</version>
        <executions>
          <execution>
            <goals>
              <goal>addSources</goal>
              <goal>addTestSources</goal>
              <goal>compile</goal>
              <goal>compileTests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <!-- any version of Groovy \>= 1.5.0 should work here -->
      <version>2.5.8</version>
      <type>pom</type>
    </dependency>
  </dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)

当我构建时,我在编译阶段收到以下错误。

[INFO] --- gmavenplus-plugin:1.8:compile (default) @ myapp---
[INFO] Unable to get Groovy version from GroovySystem, trying InvokerHelper.
[WARNING] Unable to get Groovy version from InvokerHelper or GroovySystem, trying …
Run Code Online (Sandbox Code Playgroud)

groovy maven

3
推荐指数
1
解决办法
5517
查看次数