首页 \ 问答 \ Laravel无法通过nginx获取param标头(Laravel can't get param header in request with nginx)

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 with nginx, I always get null

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
更新时间:2021-11-29 18:11

最满意答案

这里是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.

相关问答

更多
  • 如果要为“[”指定特定方法,那么您应该能够使用: `[.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 ...
  • 这里是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 ...
  • 根据评论,您可以使用以下内容: 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: ...
  • 这是浮点运算: > 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.
  • 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 ...
  • 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 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)