我的目的是让我的静态网站文件(在 React 中,如果这是一个因素)只能通过我的域而不是直接通过 S3 URL 访问。它似乎在我自己的计算机上运行(尽管这可能是存储桶公开时的 CloudFront 缓存),但其他客户端仅接收 XML 格式的 S3 消息。请求没有任何路径的域会给出响应。请求任何路径(例如/index.html,我的存储桶中的文件)都会给出代码 NoSuchKey 的响应。
我究竟做错了什么?这是当前的配置。
编辑:我的存储桶策略(我需要添加另一个操作吗?)
{
"Version": "2008-10-17", …Run Code Online (Sandbox Code Playgroud) 我正在尝试调试我的应用程序和Stripe 的 Elements 组件库之间的集成。在沙箱模式下一切正常,但我们在3D 安全身份验证过程中遇到了生产问题。这涉及到将 iframe 加载到我们的应用程序中,其中包含来自信用卡发卡机构的表单(通常通过技术合作伙伴,如Arcot)。
表单正确加载,其按钮按预期工作,但元素(对于 SMS 一次性代码)没有行为。每次我单击输入时,都会立即将焦点推回 iframe 的元素。这使得我无法输入任何内容,因为当我触摸按键时,输入内容已不在焦点上。作为参考,可以使用更改输入的值document.getElementById('enterPIN').value = '123456';
我不确定我的应用程序是否正在触发focus()调用(我不这么认为),或者它是否是 iframe 代码甚至 Stripe 的某些部分。有没有一种好方法来监视 DOM 事件并对每个事件的触发进行堆栈跟踪?
我在Excel VBA中使用正则表达式来解析游泳结果.该代码读取从PDF复制的一行文本,并将重要数据输出到单个单元格中.由于字符串的格式在源PDF中各不相同,因此正则表达式非常复杂.不过,我现在能够解析95%的数据.
但是,有些未被解析的行让我很困惑.VBA显然无法找到与正则表达式的匹配,但是当我将完全相同的正则表达式和字符串复制到此网站时,JavaScript能够找到匹配而没有问题.VBA和JavaScript处理可能导致这种情况的正则表达式的方式有什么不同吗?
这是VBA拒绝匹配的字符串:
12. NUNEZ CHENG, Walter 74 Club Tennis Las Terr 3:44.57 123
Run Code Online (Sandbox Code Playgroud)
这是我在Excel中使用的功能(主要是成功的):
Function singleLineResults(SourceString As String) As Variant
Dim cSubmatches As Variant
Dim collectionArray(11) As String
Dim cnt As Integer
Dim oMatches As MatchCollection
With New RegExp
.MultiLine = MultiLine
.IgnoreCase = IgnoreCase
.Global = False
'1. JAROSOVA, Lenka 27 Swimmpower Prague 2:26.65 605 34.45 37.70 37.79 36.71
.Pattern = "(\d*)\.?\s?([^,]+),\s([^\d]+)\s?(\d+)\s((?:[A-Z]{3})?)\s?((?:(?!\d\:\d).)*)\s?((?:\d+:)?\d+\.\d+)(?:\s(\d+))?(?:\s((?:\d+:)?\d+.\d+))?(?:\s((?:\d+:)?\d+.\d+))?(?:\s((?:\d+:)?\d+.\d+))?(?:\s((?:\d+:)?\d+.\d+))?(?:Splash Meet Manager 11, Build \d{5} Registered to [\w\s]+ 2014-08-\d+ \d+:\d+ - Page \d+)?$" …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 AWS 的云开发工具包为我网站的某些子域创建 SSL 证书。问题是我正在使用 AWS Organizations 并且相关资源属于不同的 AWS 账户。我的域的托管区域是我们主帐户的一部分,但我正在运行 CDK 在链接帐户中部署堆栈。这意味着该类DnsValidatedCertificate 能够请求新证书(堆栈回滚后它们在ACM中仍然可见),但在尝试创建 DNS 记录以自动验证请求时会引发错误。
这是错误(我的帐号和堆栈名称已编辑):
5/6 | 22:44:14 | CREATE_FAILED | AWS::CloudFormation::CustomResource | SubSubDomainsCertificate/CertificateRequestorResource/Default (SubSubDomainsCertificateCertificateRequestorResourceBC626C85) Failed to create resource. User: arn:aws:sts::123456789012:assumed-role/MyStack-SubSubDomainsCertificateCertificat-16QRI74P8POO2/MyStack-SubSubDomainsCertificateCertificat-BXZ55WHIH1XC is not authorized to access this resource
new CustomResource (C:\repos\my-project\node_modules\@aws-cdk\aws-cloudformation\lib\custom-resource.ts:92:21)
\_ new DnsValidatedCertificate (C:\repos\my-project\node_modules\@aws-cdk\aws-certificatemanager\lib\dns-validated-certificate.ts:81:29)
\_ new MyStack (C:\repos\my-project\.elasticbeanstalk\api-stack.js:91:25)
Run Code Online (Sandbox Code Playgroud)
这是相关的 CDK 代码(同样,HZ 和域已编辑):
// Executed with `cdk deploy --profile profileForLinkedAwsAccount`
const hostedZone = route53.HostedZone.fromHostedZoneAttributes(
this,
'MyDomainHostedZone',
{
hostedZoneId: 'Z2ABC1234RYN', // in master AWS account …Run Code Online (Sandbox Code Playgroud) amazon-web-services aws-cloudformation amazon-iam aws-sts aws-cdk
我正在尝试使用date一步保存变量名称。但是,在后面的步骤中,它似乎是未定义的(或空的?)。我在这里缺少什么?
jobs:
# Create release branch for the week
branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Format the date of next Tuesday
id: tuesday
run: echo "abbr=$(date -v+tuesday +'%y%m%d')" >> $GITHUB_ENV
- name: Create a branch with next tuesday's date
uses: peterjgrainger/action-create-branch@v2.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: release/${{ steps.tuesday.outputs.abbr }}
Run Code Online (Sandbox Code Playgroud)
错误:
refs/heads/release/ is not a valid ref name.
Run Code Online (Sandbox Code Playgroud) 该dotenv模块应该优先考虑我的.env.local文件而不是我的.env文件,但事实并非如此。当我REACT_APP_API_BASE在两个文件中进行设置时,应用程序始终使用.env. .env.local如果我删除 中的匹配定义,它仅使用中的值.env。
.env
REACT_APP_API_BASE = 'https://api-staging.mysite.com/api'
Run Code Online (Sandbox Code Playgroud)
.env.local
REACT_APP_API_BASE = 'https://api-qa.mysite.com/api'
Run Code Online (Sandbox Code Playgroud)
该应用程序正在对https://api-staging.mysite.com/api/endpoint进行 API 调用。
我究竟做错了什么?
作为参考,我没有react-scripts直接运行,我正在使用 CRACO。
包.json
"scripts": {
"start": "craco start",
"build": "craco build"
},
"dependencies": {
"@craco/craco": "^6.0.0",
"@material-ui/core": "^4.11.2",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.57",
"@sentry/react": "^6.2.2",
"@sentry/tracing": "^6.2.2",
"@sentry/webpack-plugin": "^1.14.0",
"@stripe/react-stripe-js": "^1.3.0",
"@stripe/stripe-js": "^1.13.0",
"mixpanel-browser": "^2.41.0",
"react": "^16.6.0",
"react-dom": "^16.0.0",
"react-gtm-module": "^2.0.11",
"react-intl": "^5.10.14",
"react-router-dom": "^5.2.0",
"react-scripts": …Run Code Online (Sandbox Code Playgroud) 我正在将一个应用程序从 Sails.js v0.12 迁移到 v1.0,其中包括将 mocha 从 ^3.5.0 升级到 ^5.2.0。我认为这是问题的根源,但我似乎找不到解决办法。
\n\n以前,当测试失败时,mocha 报告器输出的末尾会有错误摘要:失败的具体断言、文件名、行号、错误消息等。现在,报告器正在为 it块着色红色,但没有显示其他详细信息。
\n\n我尝试更改 mocha.opts 中的报告器,该报告器适用于实际执行输出,但最后没有任何内容启用摘要。我缺少什么?
\n\n// ./test/integration/models/User.test.js\n\ndescribe('User', () => {\n\n describe('find()', () => {\n it('should return an array of users', () => {\n return User.find()\n .then((users) => {\n\n users.should.be.a('array');\n true.should.be.false; // No problems if this is removed\n\n });\n });\n });\n\n});\nRun Code Online (Sandbox Code Playgroud)\n\n在控制台中:
\n\n> node ./node_modules/mocha/bin/mocha test/lifecycle.test.js test/integration/**/*.test.js\n\n\n\xe2\x88\x9a OtherModel method() should do something: 17ms\n1) User find() should return an array of users\n'Done.'\nPS C:\\repos\\myproject>\nRun Code Online (Sandbox Code Playgroud)\n 我有一个几乎全新的 Sails.js 1.0.2 应用程序,我可以使用浏览器和 Postman 登录。但是,我似乎无法在我的测试运行器中执行相同的过程。
下面的测试应该会导致成功登录,其中会返回一个带有新会话 ID 的 cookie。如果我更改安全配置以禁用CSRF 保护,它会完美运行。但是在启用安全性的情况下,请求被禁止 (403)。我在 Postman 中发送的内容之间唯一的实质性区别似乎是 mocha 在不同的端口上运行应用程序(Postman 发送到localhost:1337, express' res 变量说PUT /api/v1/entrance/login HTTP/1.1 Host: 127.0.0.1:56002
有人看到我遗漏的东西吗?
这是测试文件:
/**
* /test/integration/controllers/entrance/login.test.js
*/
'use strict';
const supertest = require('supertest'); // also tried supertest-session
describe('Entrance controllers', () => {
describe('/api/v1/entrance/login', () => {
before(() => {
return supertest(sails.hooks.http.app)
.get('/login')
.then(res => {
const reTokenCapture = /_csrf:\s*unescape\('([^']+)'\)/;
const found = reTokenCapture.exec(res.text);
this._csrf = sails.config.security.csrf ? found[1] : '';
this.url = …Run Code Online (Sandbox Code Playgroud)