Laravel无法通过nginx获取param标头(Laravel can't get param header in request with nginx)
我正在开发一个Laravel项目(API),我在请求标头中遇到了自定义参数问题。
我需要在请求标头中发送一个令牌,所以我只需在我的请求中添加一个param
api_token
。当我在本地配置
apache2
,我可以在Laravel中使用$request->header('api_token')
获取我的头请求参数,但是当我在配置了nginx
服务器上nginx
,我总是得到null
对我来说,nginx和头请求有问题,我该怎么办?
有任何想法吗 ? 也许它不是来自nginx ......
I'm working on a Laravel project (an API) and I have a problem with a custom param in the request header.
I need to send a token in the request header, so I just add a param
api_token
in my request.When I am on my local configured with
apache2
, I can in Laravel get my header request param with$request->header('api_token')
, but when I tr on my server configured withnginx
, I always getnull
For me, there is a problem with nginx and header request, what can I do ?
Any ideas ? Maybe it's not from nginx...
原文:https://stackoverflow.com/questions/40589378
最满意答案
这里是imputeTS包的作者。 谢谢你的电邮。
这确实没什么特色......这是一个小虫子。 我直接修复了这个bug。
不幸的是,在你写信给我之前几个小时我在CRAN上传了一个新的软件包版本。 否则它将已包含在2.1更新中。 我将使用本周末包含的错误修正进行更新。
如果您需要同时使用固定版本,可以直接从github安装新版本:
library(devtools) install_github("SteffenMoritz/imputeTS")
对于那些感兴趣的人,问题是:
这是C ++ Code I通过Rcpp调用的一个问题。 我忘了制作一个对象的深层副本。
Author of imputeTS package here. Thanks for your e-mail.
This is indeed no feature...it is rather a small bug. I directly fixed this bug.
Unfortunately I uploaded a new package version on CRAN just hours before you wrote me. Otherwise it would have been already included in the 2.1 update. I will make a update with the bugfix included by the end of the week.
If you need a fixed version meanwhile, you can install the new version directly from github:
library(devtools) install_github("SteffenMoritz/imputeTS")
For the ones interested what the problem was:
It was a problem with C++ Code I call via Rcpp. I forgot to make a deep copy of an object.
相关问答
更多-
R包范围和掩蔽(R package scope and masking)[2023-04-18]
如果要为“[”指定特定方法,那么您应该能够使用: `[.data.frame`(x, TRUE, j) 或者使用inherits和陷阱来测试data.tables作为边缘情况? If you want to specify a particular method for "[" then you should be able to use: `[.data.frame`(x, TRUE, j) Or test for data.tables using inherits and trap that ... -
对于相关分析函数cor()您得到了NA值的矩阵,因为您只对每个变量进行了一次观察 - 如果变量只有一个观察值,则无法进行相关性。 您可以通过查看矩阵m来查看它 > m Terms Docs word1 word2 word3 1 5 4 3 For the correlation analysis function cor() you got the matrix of NA values because you have only one observation o ...
-
来自R imputeTS包的na.kalman函数的奇怪行为(Strange behavior of the na.kalman function from the R imputeTS package)[2024-01-01]
这里是imputeTS包的作者。 谢谢你的电邮。 这确实没什么特色......这是一个小虫子。 我直接修复了这个bug。 不幸的是,在你写信给我之前几个小时我在CRAN上传了一个新的软件包版本。 否则它将已包含在2.1更新中。 我将使用本周末包含的错误修正进行更新。 如果您需要同时使用固定版本,可以直接从github安装新版本: library(devtools) install_github("SteffenMoritz/imputeTS") 对于那些感兴趣的人,问题是: 这是C ++ Code I通过 ... -
auto.arima试图找到受某些约束限制的最佳模型,避免使用具有接近非平稳性和非可逆性边界的参数的模型。 您的tt.1模型的季节性MA(1)参数为-1,它位于非可逆性边界上。 因此,您不希望使用该模型,因为它会导致数值不稳定。 季节性差异运算符与季节性MA运算符混淆。 在内部, auto.arima将Inf的AIC / AICc / BIC值提供给任何不满足约束的模型,以避免被选中。 auto.arima tries to find the best model subject to some const ...
-
测试R中的缺失值(Testing for missing values in R)[2023-06-25]
根据评论,您可以使用以下内容: has_na <- sapply(wideRawDF, function(x) any(is.na(x))) TestMCARNormality(wideRawDF[has_na]) has_na是一个布尔向量,对应于wideRawDF每一列。 对于任何至少有一个缺失值的列,它将为TRUE。 因此, wideRawDF[has_na]是您的数据框wideRawDF ,但只是具有缺失值的列。 As per comment, you can use the following: ... -
R:奇怪的trig函数行为(R: Strange trig function behavior)[2022-04-09]
这是浮点运算: > all.equal(cosd(90), 0) [1] TRUE > all.equal(cosd(270), 0) [1] TRUE 如果这就是你的意思是“不能正常工作”? 这也是一个常见问题解答: http : //cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f This is floating point arithmetic: > all.equa ... -
尝试在wavelets::modwt明确添加命名空间,以确保它不会拾取你已经附加的wavelim。 try adding the namespace explicitly as in wavelets::modwt, to ensure it's not picking up the waveslim one you also have attached.
-
基于ID的时间序列插补(Time series Imputation based on ID)[2022-07-04]
dplyr是你的朋友: library(imputeTS) library(dplyr) datALL %>% group_by(ID) %>% mutate(Align1 = na.kalman(Align)) 结果: ID Year Align Align1 1 A01 2017 329 329.0000 2 A01 2016 NA 318.9847 3 A01 2015 NA 312.7852 4 A01 2014 314 314.0000 ... -
R中的NA的累积回报(Cumulative Returns with NA's in R)[2023-08-10]
cumpfun <- function(x){ x[!is.na(x)] <- cumprod(x[!is.na(x)]+1)-1 x } sapply(df,cumpfun) # Return1 Return2 Return3 # [1,] NA 0.2500000 0.0400000 # [2,] NA 0.6625000 0.1159200 # [3,] 0.03000 NA 0.2051936 # [4,] 0.07120 0.73731 ... -
levelplot使用背景颜色显示NA值。 因此,您必须使用panel.background修改此颜色。 library(rasterVis) myTheme <- BTCTheme() myTheme$panel.background$col = 'gray' f <- system.file("external/test.grd", package="raster") r <- raster(f) levelplot(r, par.settings = myTheme) levelplot us ...