小编Urv*_*pta的帖子

Safari在http重定向上丢失哈希参数

我正面临一个问题,其中url片段在Safari中的重定向时没有被保留,因为它们应该根据http规范.


设定 -

`/url1` redirects to `/url2#hash`

`/url2` redirects to `/url3`
Run Code Online (Sandbox Code Playgroud)

预期的行为 -

Hitting `/url1` should redirect to `/url3#hash`
Run Code Online (Sandbox Code Playgroud)

观察到的行为 -

Chrome/FF - Hitting `/url1` redirects to `/url3#hash`
Safari(11+) - Hitting `/url1` redirects to `/url3`
Run Code Online (Sandbox Code Playgroud)

我确实阅读过早期版本Safari报告的问题.我也尝试过在其他SO线程中发布的解决方案是徒劳的.

任何帮助表示赞赏.

safari redirect webkit http-redirect url-redirection

16
推荐指数
1
解决办法
926
查看次数

Dynamic key access in object literal results in widened typescript signature

For the following code:

const x = {
    a: 'c',
    b: 'd'
};

const y = {
    [x.a]: 'e',
}
Run Code Online (Sandbox Code Playgroud)

the generated types are:

typeof x -> {
    a: string,
    b: string
}

typeof y -> {
  [x: string]: string
}
Run Code Online (Sandbox Code Playgroud)

Expected type:

typeof y -> {
  c: string
}
Run Code Online (Sandbox Code Playgroud)

Similar issue on SO has a solution which is not relevant here

在Github上发现了已举报的问题,该问题已解决,但无法正常工作

typescript

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